Difference between revisions of "User roles.pl"
m (typo corrected) |
m (update map for 3.3.15) |
||
Line 56: | Line 56: | ||
==List of Roles and privileges== | ==List of Roles and privileges== | ||
− | This is a full list of privileges defined in EPrints 3. | + | This is a full list of privileges defined in EPrints 3.3.15. They are just strings so you create your own when you create a role in user roles.pl |
<pre> | <pre> | ||
Line 63: | Line 63: | ||
general => | general => | ||
[ | [ | ||
− | "user/view", | + | "user/view:owner", |
+ | "user/details:owner", | ||
+ | "user/history:owner", | ||
], | ], | ||
Line 92: | Line 94: | ||
"eprint/inbox/view", | "eprint/inbox/view", | ||
"eprint/inbox/summary", | "eprint/inbox/summary", | ||
− | "eprint/inbox | + | "eprint/inbox/export", |
− | "eprint/inbox | + | "eprint/inbox/details", |
"eprint/inbox/history", | "eprint/inbox/history", | ||
"eprint/buffer/view", | "eprint/buffer/view", | ||
"eprint/buffer/summary", | "eprint/buffer/summary", | ||
− | "eprint/buffer | + | "eprint/buffer/export", |
− | "eprint/buffer | + | "eprint/buffer/details", |
"eprint/buffer/history", | "eprint/buffer/history", | ||
"eprint/archive/view", | "eprint/archive/view", | ||
− | "eprint/archive | + | "eprint/archive/export", |
− | + | "eprint/archive/details", | |
− | "eprint/archive | ||
"eprint/archive/history", | "eprint/archive/history", | ||
"eprint/deletion/view", | "eprint/deletion/view", | ||
"eprint/deletion/summary", | "eprint/deletion/summary", | ||
− | "eprint/deletion | + | "eprint/deletion/export", |
− | "eprint/deletion | + | "eprint/deletion/details", |
"eprint/deletion/history", | "eprint/deletion/history", | ||
− | "staff | + | "eprint/search/staff", |
], | ], | ||
Line 127: | Line 128: | ||
"indexer/start", | "indexer/start", | ||
"indexer/force_start", | "indexer/force_start", | ||
− | |||
− | |||
− | |||
− | |||
"create_user", | "create_user", | ||
− | "subject/edit | + | "subject/edit", |
"staff/user_search", | "staff/user_search", | ||
"staff/history_search", | "staff/history_search", | ||
Line 148: | Line 145: | ||
"config/view/perl", | "config/view/perl", | ||
"config/test_email", | "config/test_email", | ||
+ | "config/imports", | ||
"config/add_field", | "config/add_field", | ||
"config/remove_field", | "config/remove_field", | ||
"config/regen_abstracts", | "config/regen_abstracts", | ||
"config/regen_views", | "config/regen_views", | ||
− | " | + | "config/edit/perl", |
− | " | + | |
+ | "storage/manager", | ||
+ | "repository/epm", #EPrints Package Manager | ||
+ | |||
+ | "event_queue/destroy", | ||
+ | "event_queue/details", | ||
+ | "event_queue/edit", | ||
+ | "event_queue/export", | ||
+ | "event_queue/view", | ||
+ | "eprint/destroy", | ||
+ | "eprint/details", | ||
+ | "eprint/edit", | ||
+ | "eprint/export", | ||
+ | "eprint/upsert", | ||
+ | "eprint/view", | ||
+ | "eprint/archive/remove", | ||
+ | "eprint/archive/edit", # BatchEdit | ||
+ | "file/destroy", | ||
+ | "file/export", | ||
+ | "file/view", | ||
+ | "import/view", | ||
+ | "import/edit", | ||
+ | "saved_search/destroy", | ||
+ | "saved_search/details", | ||
+ | "saved_search/edit", | ||
+ | "saved_search/export", | ||
+ | "saved_search/view", | ||
+ | "user/remove", | ||
+ | "user/edit", | ||
+ | "user/view", | ||
+ | "user/details", | ||
+ | "user/destroy", | ||
+ | "user/history", | ||
+ | "user/staff/edit", | ||
+ | "repository/epm-submit", #EPrints Package Manager - Bazaar Package Submission | ||
], | ], | ||
Line 181: | Line 213: | ||
"create_saved_search", | "create_saved_search", | ||
"saved_search/view:owner", | "saved_search/view:owner", | ||
− | |||
"saved_search/edit:owner", | "saved_search/edit:owner", | ||
− | "saved_search/ | + | "saved_search/destroy:owner", |
], | ], | ||
Line 193: | Line 224: | ||
"eprint/inbox/view:owner", | "eprint/inbox/view:owner", | ||
+ | "eprint/inbox/export:owner", | ||
"eprint/inbox/summary:owner", | "eprint/inbox/summary:owner", | ||
+ | "eprint/inbox/destroy:owner", | ||
"eprint/inbox/deposit:owner", | "eprint/inbox/deposit:owner", | ||
"eprint/inbox/edit:owner", | "eprint/inbox/edit:owner", | ||
"eprint/inbox/remove:owner", | "eprint/inbox/remove:owner", | ||
− | |||
"eprint/inbox/details:owner", | "eprint/inbox/details:owner", | ||
"eprint/inbox/history:owner", | "eprint/inbox/history:owner", | ||
Line 209: | Line 241: | ||
"eprint/buffer/view:owner", | "eprint/buffer/view:owner", | ||
+ | "eprint/buffer/export:owner", | ||
"eprint/buffer/summary:owner", | "eprint/buffer/summary:owner", | ||
"eprint/buffer/move_inbox:owner", | "eprint/buffer/move_inbox:owner", | ||
− | |||
"eprint/buffer/details:owner", | "eprint/buffer/details:owner", | ||
"eprint/buffer/history:owner", | "eprint/buffer/history:owner", | ||
Line 222: | Line 254: | ||
"eprint/archive/view:owner", | "eprint/archive/view:owner", | ||
+ | "eprint/archive/export:owner", | ||
"eprint/archive/summary:owner", | "eprint/archive/summary:owner", | ||
− | |||
"eprint/archive/details:owner", | "eprint/archive/details:owner", | ||
"eprint/archive/history:owner", | "eprint/archive/history:owner", | ||
Line 234: | Line 266: | ||
"eprint/deletion/view:owner", | "eprint/deletion/view:owner", | ||
+ | "eprint/deletion/export:owner", | ||
"eprint/deletion/summary:owner", | "eprint/deletion/summary:owner", | ||
− | |||
"eprint/deletion/details:owner", | "eprint/deletion/details:owner", | ||
"eprint/deletion/history:owner", | "eprint/deletion/history:owner", | ||
Line 246: | Line 278: | ||
editor => | editor => | ||
[ | [ | ||
+ | "datasets", | ||
+ | |||
"editorial_review", | "editorial_review", | ||
"eprint/inbox/view:editor", | "eprint/inbox/view:editor", | ||
+ | "eprint/inbox/export:editor", | ||
"eprint/inbox/summary:editor", | "eprint/inbox/summary:editor", | ||
− | "eprint/inbox | + | "eprint/inbox/export:editor", |
− | "eprint/inbox | + | "eprint/inbox/details:editor", |
"eprint/inbox/history:editor", | "eprint/inbox/history:editor", | ||
"eprint/inbox/messages:editor", | "eprint/inbox/messages:editor", | ||
Line 260: | Line 295: | ||
"eprint/inbox/use_as_template:editor", | "eprint/inbox/use_as_template:editor", | ||
"eprint/inbox/derive_version:editor", | "eprint/inbox/derive_version:editor", | ||
− | "eprint/inbox/ | + | "eprint/inbox/edit:editor", |
+ | "eprint/inbox/takelock:editor", | ||
"eprint/buffer/view:editor", | "eprint/buffer/view:editor", | ||
+ | "eprint/buffer/export:editor", | ||
"eprint/buffer/summary:editor", | "eprint/buffer/summary:editor", | ||
− | "eprint/buffer | + | "eprint/buffer/export:editor", |
− | "eprint/buffer | + | "eprint/buffer/details:editor", |
"eprint/buffer/history:editor", | "eprint/buffer/history:editor", | ||
"eprint/buffer/messages:editor", | "eprint/buffer/messages:editor", | ||
Line 277: | Line 314: | ||
"eprint/buffer/use_as_template:editor", | "eprint/buffer/use_as_template:editor", | ||
"eprint/buffer/derive_version:editor", | "eprint/buffer/derive_version:editor", | ||
− | "eprint/buffer/ | + | "eprint/buffer/edit:editor", |
+ | "eprint/buffer/takelock:editor", | ||
"eprint/archive/view:editor", | "eprint/archive/view:editor", | ||
− | "eprint/archive | + | "eprint/archive/export:editor", |
− | + | "eprint/archive/details:editor", | |
− | "eprint/archive | ||
"eprint/archive/history:editor", | "eprint/archive/history:editor", | ||
"eprint/archive/messages:editor", | "eprint/archive/messages:editor", | ||
Line 292: | Line 329: | ||
"eprint/archive/use_as_template:editor", | "eprint/archive/use_as_template:editor", | ||
"eprint/archive/derive_version:editor", | "eprint/archive/derive_version:editor", | ||
− | "eprint/archive/ | + | "eprint/archive/edit:editor", |
+ | "eprint/archive/takelock:editor", | ||
"eprint/deletion/view:editor", | "eprint/deletion/view:editor", | ||
+ | "eprint/deletion/export:editor", | ||
"eprint/deletion/summary:editor", | "eprint/deletion/summary:editor", | ||
− | "eprint/deletion | + | "eprint/deletion/export:editor", |
− | "eprint/deletion | + | "eprint/deletion/details:editor", |
"eprint/deletion/history:editor", | "eprint/deletion/history:editor", | ||
"eprint/deletion/messages:editor", | "eprint/deletion/messages:editor", | ||
Line 305: | Line 344: | ||
"eprint/deletion/use_as_template:editor", | "eprint/deletion/use_as_template:editor", | ||
"eprint/deletion/derive_version:editor", | "eprint/deletion/derive_version:editor", | ||
+ | "eprint/deletion/takelock:editor", | ||
+ | ], | ||
+ | |||
+ | rest => [ | ||
+ | "eprint/archive/rest/get:editor", | ||
+ | "eprint/archive/rest/put:editor", | ||
+ | "eprint/buffer/rest/get:editor", | ||
+ | "eprint/buffer/rest/put:editor", | ||
+ | "eprint/inbox/rest/get:editor", | ||
+ | "eprint/inbox/rest/put:editor", | ||
+ | "eprint/deletion/rest/get:editor", | ||
+ | "eprint/deletion/rest/put:editor", | ||
+ | |||
+ | "eprint/inbox/rest/get:owner", | ||
+ | "eprint/inbox/rest/put:owner", | ||
+ | "eprint/buffer/rest/get:owner", | ||
+ | "eprint/archive/rest/get:owner", | ||
+ | "eprint/deletion/rest/get:owner", | ||
+ | |||
+ | "user/rest/get:owner", | ||
+ | |||
+ | "subject/rest/get", | ||
], | ], | ||
}; | }; | ||
+ | |||
</pre> | </pre> |
Revision as of 03:39, 20 September 2018
User roles control various aspects of what a user can do in eprints. By default there are 4 categories of user: Administrator, Editor, User, and minimal User. user_roles.pl controls what each class of user can do. You can also make your own classes of user in this file.
A role in EPrints is made up of 1 or more privileges. Giving a user a role gives them all the privileges associated with that role. You can also give users additional privileges without giving them the full role.
Contents
Creating a role
To create the role approve-hat
you would do the following:
$c->{roles}->{"approve-hat"} = [ "eprint/buffer/view:editor", "eprint/buffer/summary:editor", "eprint/buffer/details:editor", "eprint/buffer/move_archive:editor", ];
The privileges listed above means the users given the approve-hat
role can see the View, Summary, Details and Move to archive screen as an editor. Note because they cannot edit items in the buffer they can't correct any mistakes they find. However they do have the power to move items to the archive. This means the approve-hat
allows a user to see the metadata of an item and if they think it is correct move it to the archive. They cannot return it to the user or edit the metadata themselves.
Assigning a role
Now that you have created a role you want to give that to class of users. To give every regular user of the repository the approve-hat
you add it to the list of roles for the user.
$c->{user_roles}->{user} = [ 'general', 'edit-own-record', 'saved-searches', 'set-password', 'deposit', 'change-email', 'approve-hat', ],
Rather than giving every user the role you can give it to individual users. Administer a users profile and add the name of the role to their list of additional roles.
Assigning a user privilege
You do not have to give a user a full role you can give them a privilege. The syntax is slightly different. Add the name of the privilege prefixed with a '+' to the list of roles. You can remove a privilege by prefixing it with a '-'.
$c->{user_roles}->{user} = [ 'general', 'edit-own-record', 'saved-searches', 'set-password', 'deposit', 'change-email', 'approve-hat', '+eprint/archive/edit:owner', ],
You can also assign privileges to individual users through the web interface in the same way you can assign a role. (remember the '+' or '-')
List of Roles and privileges
This is a full list of privileges defined in EPrints 3.3.15. They are just strings so you create your own when you create a role in user roles.pl
{ general => [ "user/view:owner", "user/details:owner", "user/history:owner", ], "edit-own-record" => [ "user/edit:owner", ], "set-password" => [ "set-password", ], "change-email" => [ # not done ], "change-user" => [ # not done ], "staff-view" => [ # still needs search tools "eprint/inbox/view", "eprint/inbox/summary", "eprint/inbox/export", "eprint/inbox/details", "eprint/inbox/history", "eprint/buffer/view", "eprint/buffer/summary", "eprint/buffer/export", "eprint/buffer/details", "eprint/buffer/history", "eprint/archive/view", "eprint/archive/export", "eprint/archive/details", "eprint/archive/history", "eprint/deletion/view", "eprint/deletion/summary", "eprint/deletion/export", "eprint/deletion/details", "eprint/deletion/history", "eprint/search/staff", ], "view-status" => [ "status" ], "admin" => [ "indexer/stop", "indexer/start", "indexer/force_start", "create_user", "subject/edit", "staff/user_search", "staff/history_search", "staff/issue_search", "config/view", "config/view/xml", "config/view/workflow", "config/view/citation", "config/view/phrase", "config/view/namedset", "config/view/template", "config/view/static", "config/view/autocomplete", "config/view/apache", "config/view/perl", "config/test_email", "config/imports", "config/add_field", "config/remove_field", "config/regen_abstracts", "config/regen_views", "config/edit/perl", "storage/manager", "repository/epm", #EPrints Package Manager "event_queue/destroy", "event_queue/details", "event_queue/edit", "event_queue/export", "event_queue/view", "eprint/destroy", "eprint/details", "eprint/edit", "eprint/export", "eprint/upsert", "eprint/view", "eprint/archive/remove", "eprint/archive/edit", # BatchEdit "file/destroy", "file/export", "file/view", "import/view", "import/edit", "saved_search/destroy", "saved_search/details", "saved_search/edit", "saved_search/export", "saved_search/view", "user/remove", "user/edit", "user/view", "user/details", "user/destroy", "user/history", "user/staff/edit", "repository/epm-submit", #EPrints Package Manager - Bazaar Package Submission ], "toolbox" => [ "toolbox", ], "edit-config" => [ "config/edit", "config/edit/xml", "config/edit/workflow", "config/edit/citation", "config/edit/phrase", "config/edit/namedset", "config/edit/template", "config/edit/static", "config/edit/autocomplete", # not editing perl files or apache files! "config/reload", ], "saved-searches" => [ "saved_search", "create_saved_search", "saved_search/view:owner", "saved_search/edit:owner", "saved_search/destroy:owner", ], deposit => [ "items", "create_eprint", "user/history:owner", "eprint/inbox/view:owner", "eprint/inbox/export:owner", "eprint/inbox/summary:owner", "eprint/inbox/destroy:owner", "eprint/inbox/deposit:owner", "eprint/inbox/edit:owner", "eprint/inbox/remove:owner", "eprint/inbox/details:owner", "eprint/inbox/history:owner", "eprint/inbox/messages:owner", "eprint/inbox/issues:owner", "eprint/inbox/deposit:owner", "eprint/inbox/use_as_template:owner", "eprint/inbox/derive_version:owner", "eprint/buffer/view:owner", "eprint/buffer/export:owner", "eprint/buffer/summary:owner", "eprint/buffer/move_inbox:owner", "eprint/buffer/details:owner", "eprint/buffer/history:owner", "eprint/buffer/messages:owner", "eprint/buffer/request_removal:owner", "eprint/buffer/use_as_template:owner", "eprint/buffer/derive_version:owner", "eprint/archive/view:owner", "eprint/archive/export:owner", "eprint/archive/summary:owner", "eprint/archive/details:owner", "eprint/archive/history:owner", "eprint/archive/messages:owner", "eprint/archive/request_removal:owner", "eprint/archive/use_as_template:owner", "eprint/archive/derive_version:owner", "eprint/deletion/view:owner", "eprint/deletion/export:owner", "eprint/deletion/summary:owner", "eprint/deletion/details:owner", "eprint/deletion/history:owner", "eprint/deletion/messages:owner", "eprint/deletion/use_as_template:owner", "eprint/deletion/derive_version:owner", ], editor => [ "datasets", "editorial_review", "eprint/inbox/view:editor", "eprint/inbox/export:editor", "eprint/inbox/summary:editor", "eprint/inbox/export:editor", "eprint/inbox/details:editor", "eprint/inbox/history:editor", "eprint/inbox/messages:editor", "eprint/inbox/remove_with_email:editor", "eprint/inbox/move_archive:editor", "eprint/inbox/move_buffer:editor", "eprint/inbox/use_as_template:editor", "eprint/inbox/derive_version:editor", "eprint/inbox/edit:editor", "eprint/inbox/takelock:editor", "eprint/buffer/view:editor", "eprint/buffer/export:editor", "eprint/buffer/summary:editor", "eprint/buffer/export:editor", "eprint/buffer/details:editor", "eprint/buffer/history:editor", "eprint/buffer/messages:editor", "eprint/buffer/issues:editor", "eprint/buffer/remove_with_email:editor", "eprint/buffer/reject_with_email:editor", "eprint/buffer/move_inbox:editor", "eprint/buffer/move_archive:editor", "eprint/buffer/use_as_template:editor", "eprint/buffer/derive_version:editor", "eprint/buffer/edit:editor", "eprint/buffer/takelock:editor", "eprint/archive/view:editor", "eprint/archive/export:editor", "eprint/archive/details:editor", "eprint/archive/history:editor", "eprint/archive/messages:editor", "eprint/archive/issues:editor", "eprint/archive/move_buffer:editor", "eprint/archive/move_deletion:editor", "eprint/archive/use_as_template:editor", "eprint/archive/derive_version:editor", "eprint/archive/edit:editor", "eprint/archive/takelock:editor", "eprint/deletion/view:editor", "eprint/deletion/export:editor", "eprint/deletion/summary:editor", "eprint/deletion/export:editor", "eprint/deletion/details:editor", "eprint/deletion/history:editor", "eprint/deletion/messages:editor", "eprint/deletion/move_archive:editor", "eprint/deletion/use_as_template:editor", "eprint/deletion/derive_version:editor", "eprint/deletion/takelock:editor", ], rest => [ "eprint/archive/rest/get:editor", "eprint/archive/rest/put:editor", "eprint/buffer/rest/get:editor", "eprint/buffer/rest/put:editor", "eprint/inbox/rest/get:editor", "eprint/inbox/rest/put:editor", "eprint/deletion/rest/get:editor", "eprint/deletion/rest/put:editor", "eprint/inbox/rest/get:owner", "eprint/inbox/rest/put:owner", "eprint/buffer/rest/get:owner", "eprint/archive/rest/get:owner", "eprint/deletion/rest/get:owner", "user/rest/get:owner", "subject/rest/get", ], };