mirror of
https://github.com/Mibew/mibew.git
synced 2025-01-31 13:24:41 +03:00
parent
48bcea8f65
commit
4670851505
@ -52,7 +52,7 @@ define('CAN_MODIFYPROFILE', 3);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Map numerical permissions ids onto string names.
|
* Map numerical permissions ids onto string names.
|
||||||
* @return array Associativa array whose keys are numerical permission ids and
|
* @return array Associative array whose keys are numerical permission ids and
|
||||||
* values are string permission names.
|
* values are string permission names.
|
||||||
*/
|
*/
|
||||||
function permission_ids()
|
function permission_ids()
|
||||||
@ -65,6 +65,24 @@ function permission_ids()
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map numerical permissions ids onto its descriptions.
|
||||||
|
*
|
||||||
|
* The descriptions are NOT localized.
|
||||||
|
*
|
||||||
|
* @return array Array whose keys are numerical permission ids and values are
|
||||||
|
* permission descriptions.
|
||||||
|
*/
|
||||||
|
function permission_descriptions()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
CAN_ADMINISTRATE => 'System administration: settings, operators management, button generation',
|
||||||
|
CAN_TAKEOVER => 'Take over chat thread',
|
||||||
|
CAN_VIEWTHREADS => 'View another operator\'s chat thread',
|
||||||
|
CAN_MODIFYPROFILE => 'Ability to modify profile',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set new permissions to operator
|
* Set new permissions to operator
|
||||||
* @param int $operator_id Operator ID
|
* @param int $operator_id Operator ID
|
||||||
@ -606,10 +624,11 @@ function get_permission_list()
|
|||||||
static $permission_list = array();
|
static $permission_list = array();
|
||||||
|
|
||||||
if (count($permission_list) == 0) {
|
if (count($permission_list) == 0) {
|
||||||
foreach (permission_ids() as $perm_id) {
|
$descriptions = permission_descriptions();
|
||||||
|
foreach (permission_ids() as $perm_code => $perm_id) {
|
||||||
$permission_list[] = array(
|
$permission_list[] = array(
|
||||||
'id' => $perm_id,
|
'id' => $perm_id,
|
||||||
'descr' => getlocal("permission.$perm_id"),
|
'descr' => getlocal($descriptions[$perm_code]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user