Skip to content
Snippets Groups Projects
Commit 87ab6594 authored by Lev Tsypin's avatar Lev Tsypin
Browse files

#1616944: Add permission to manage own registration type settings.

parent fc0ff8c4
No related branches found
No related tags found
No related merge requests found
......@@ -244,6 +244,10 @@ function registration_permission_list($info) {
'title' => t('%type_name: Administer settings', array('%type_name' => $label)),
'description' => t('Allow changing registration settings for entities with this type.'),
),
"administer own $type registration" => array(
'title' => t('%type_name: Administer own settings', array('%type_name' => $label)),
'description' => t('Allow changing registration settings for entities with this type authored by the given user.'),
),
"view $type registration" => array(
'title' => t('%type_name: View all registrations', array('%type_name' => $label)),
),
......@@ -355,11 +359,14 @@ function registration_register_page_access($entity_type, $entity) {
*/
function registration_administer_registrations_access($entity_type, $entity) {
$registration_type = registration_get_entity_registration_type($entity_type, $entity);
$ret = FALSE;
if ($registration_type) {
return user_access("administer $registration_type registration");
if (!$ret = user_access("administer $registration_type registration")) {
$ret = user_access("administer own $registration_type registration");
}
}
return FALSE;
return $ret;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment