Dancer::Plugin::Auth::RBAC::Permissions::DBIC - Auth::RBAC Permissions via DBIx::Class
if ( auth->asa('guest') ) { ... } if ( auth->can('manage_accounts', 'create') ) { ... }
Uses your DBIx::Class schema to provide the authorisation part of the RBAC user management system.
Note that you do not use this module directly. Use Dancer::Plugin::Auth::RBAC and configure it to use the DBIC class in your Dancer configuration (see below).
See Dancer::Plugin::Auth::RBAC::Credentials::DBIC for authentication and role management via DBIC.
There are no public methods directly from this module. Use asa and can from Dancer::Plugin::Auth::RBAC
Minimal example:
plugins: DBIC: Auth: dsn: "dbi:SQLite:dbname=./foo.db" Auth::RBAC: credentials: class: DBIC permissions: class: DBIC
The following config options are avaialable:
The handle of the Dancer::Plugin::DBIC schema to use. Only needed if you have more than one schema defined.
The moniker for the result source which holds your users. Default User.
User
The name of the relationship to get the roles of a user. Default roles.
roles
The name of the field on the role object that the role name is stored in. Default name.
name
The name of the relationship to get the permissions for a role. Default permissions.
permissions
The name of the field on the permissions object that the permission name is stored in. Default name.
The name of the relationship to get the operations for a permission. Default operations.
operations
The name of the field on the operations object that the operation name is stored in. Default name.
The RBAC relationships are as follows:
user has_many roles has_many permissions has_many operations
Dancer::Plugin::DBIC Dancer::Plugin::Auth::RBAC Dancer::Plugin::Auth::RBAC::Credentials::DBIC DBIx::Class
Jason Clifford, <jason@ukfsn.org>
Copyright (C) 2012 by Jason Clifford
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Dancer::Plugin::Auth::RBAC::Permissions::DBIC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer::Plugin::Auth::RBAC::Permissions::DBIC
CPAN shell
perl -MCPAN -e shell install Dancer::Plugin::Auth::RBAC::Permissions::DBIC
For more information on module installation, please visit the detailed CPAN module installation guide.