Changeset c59673ce8cf87c677db5c213f954df35ddbd7916
- Timestamp:
- 12/05/09 21:44:50 (9 months ago)
- Author:
- Stephen Bennett <spb@…>
- Parents:
- 712bdf504027850e862f3ebd95bd8073771ca78f
- Children:
- 60a55516fee8adb94bfd6ea006f91c9d2978b652
- git-committer:
- Stephen Bennett <spb@exherbo.org> / 2009-12-05T21:44:50Z+0000
- Message:
-
Add role-based authorisation to the GMS authentication plugin, and add the relevant DBIC result classes that this requires.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r9d997c9
|
rc59673c
|
|
| 10 | 10 | requires 'Catalyst::Plugin::ConfigLoader'; |
| 11 | 11 | requires 'Catalyst::Plugin::Static::Simple'; |
| | 12 | requires 'Catalyst::Plugin::Authentication'; |
| | 13 | requires 'Catalyst::Plugin::Authorization::Roles'; |
| 12 | 14 | requires 'Catalyst::Action::RenderView'; |
| 13 | 15 | requires 'Catalyst::View::TT'; |
-
|
r6112a5a
|
rc59673c
|
|
| 24 | 24 | |
| 25 | 25 | sub supported_features { |
| 26 | | return { session => 1 }; |
| | 26 | return { session => 1, roles => 1 }; |
| 27 | 27 | } |
| 28 | 28 | |
| … |
… |
|
| 51 | 51 | } |
| 52 | 52 | |
| | 53 | sub roles { |
| | 54 | my ($self) = @_; |
| | 55 | #return $self->{_account}->roles; |
| | 56 | my @ret; |
| | 57 | foreach my $role ($self->{_account}->roles) { |
| | 58 | push @ret, $role->name; |
| | 59 | } |
| | 60 | return @ret; |
| | 61 | } |
| | 62 | |
| 53 | 63 | 1; |
-
|
r71bc43c
|
rc59673c
|
|
| 11 | 11 | __PACKAGE__->might_have('contact', 'GMS::Schema::Result::Contact', 'account_id'); |
| 12 | 12 | |
| | 13 | __PACKAGE__->has_many(user_roles => 'GMS::Schema::Result::UserRole', 'account_id'); |
| | 14 | __PACKAGE__->many_to_many(roles => 'user_roles', 'role'); |
| | 15 | |
| 13 | 16 | 1; |
| 14 | | |
| 15 | | |
-
|
r67960fe
|
rc59673c
|
|
| 22 | 22 | |
| 23 | 23 | Authentication |
| | 24 | Authorization::Roles |
| 24 | 25 | |
| 25 | 26 | Session |