| 1 | package Crop::Rights::Role; | ||
| 2 | use base qw/ Crop::Object::Simple /; | ||
| 3 | |||
| 4 | =begin nd | ||
| 5 | Class: Crop::Rights::Realm | ||
| 6 | Object the rights are linked to. | ||
| 7 | |||
| 8 | The Role is presented by a Class name. | ||
| 9 | =cut | ||
| 10 | |||
| 11 | use v5.14; | ||
| 12 | use warnings; | ||
| 13 | |||
| 14 | =begin nd | ||
| 15 | Variable: our %Attributes | ||
| 16 | Class attributes: | ||
| 17 | |||
| 18 | active - role is off | ||
| 19 | description - description | ||
| 20 | id - id from <Crop::Object::Simple> | ||
| 21 | name - name | ||
| 22 | privileges - Collection of granted privileges | ||
| 23 | =cut | ||
| 24 | our %Attributes = ( | ||
| 25 | active => undef, | ||
| 26 | description => undef, | ||
| 27 | name => {mode => 'read'}, | ||
| 28 | privileges => {mode => 'read', type => 'cache'}, | ||
| 29 | EXT => { | ||
| 30 | privileges => { | ||
| 31 | type => 'content', | ||
| 32 | cross => [ | ||
| 33 | 'Crop::Rights::Granted' => {id => 'id_role'}, | ||
| 34 | 'Crop::Rights::Privilege' => {id_realm => 'id_realm', id_perm => 'id_perm'} | ||
| 35 | ], | ||
| 36 | view => 'privileges', | ||
| 37 | } | ||
| 38 | } | ||
| 39 | ); | ||
| 40 | |||
| 41 | =begin nd | ||
| 42 | Method: Table ( ) | ||
| 43 | Table in Warehouse. | ||
| 44 | |||
| 45 | Returns: | ||
| 46 | 'role' string | ||
| 47 | =cut | ||
| 48 | sub Table { 'role' } | ||
| 49 | |||
| 50 | 1; |