Exemplo n.º 1
0
 /**
  * Fetch all the access list ids that grant the given permission to the given user
  * (either directly or via a group).
  *
  * @param string|array $permission a single permission id (eg. 'core.view')
  *                                 or an array of permission ids
  * @param int $userId
  * @param boolean $sessionPermissions (optional) false to ignore session based permissions
  * @return array GalleryStatus a status code
  *               array int access list ids
  */
 function fetchAccessListIds($permission, $userId, $sessionPermissions=true) {
 MyOOS_CoreApi::requireOnce(
     'modules/core/classes/helpers/GalleryPermissionHelper_simple.class');
 return GalleryPermissionHelper_simple::fetchAccessListIds(
     $permission, $userId, $sessionPermissions);
 }
Exemplo n.º 2
0
 /**
  * Grant permissions identified by an entity id to the current user's session.
  *
  * @param int $entityId The permission identifier (e.g. a user, group, or entity id) which
  *                grants one or more permissions to one or more items
  */
 function addPermissionToSession($entityId)
 {
     MyOOS_CoreApi::requireOnce('modules/core/classes/helpers/GalleryPermissionHelper_simple.class');
     return GalleryPermissionHelper_simple::addPermissionToSession($entityId);
 }