Class: GalleryPermissionHelper_advanced
Source Location: /modules/core/classes/helpers/GalleryPermissionHelper_advanced.class
Class GalleryPermissionHelper_advanced
Method Summary
array |
_getAccessListCompacterLock() |
Acquire a read or write lock on our access list compacter semaphore. While we have this read lock, the access list can't be compacted. While we have a write lock, we're in the process of compacting so nobody else should be touching the access map. |
array |
_newPermissionBit() |
Return an unused permission bit that we can use for our purposes |
Methods
void addEntityPermission(
$itemId,
$entityId,
$permission, [
$applyToChildren = false]
)
|
|
Parameters:
|
$itemId: |
|
|
$entityId: |
|
|
$permission: |
|
|
$applyToChildren: |
|
API Tags:
See: | GalleryCoreApi::addEntityPermission |
void addGroupPermission(
$itemId,
$groupId,
$permission, [
$applyToChildren = false]
)
|
|
Parameters:
|
$itemId: |
|
|
$groupId: |
|
|
$permission: |
|
|
$applyToChildren: |
|
API Tags:
See: | GalleryCoreApi::addGroupPermission |
void addUserPermission(
$itemId,
$userId,
$permission, [
$applyToChildren = false]
)
|
|
Parameters:
|
$itemId: |
|
|
$userId: |
|
|
$permission: |
|
|
$applyToChildren: |
|
API Tags:
See: | GalleryCoreApi::addUserPermission |
void compactAccessLists(
)
|
|
API Tags:
See: | GalleryCoreApi::compactAccessLists |
void copyPermissions(
$toId,
$fromId
)
|
|
Parameters:
API Tags:
See: | GalleryCoreApi::copyPermissions |
void fetchAccessListId(
$itemId
)
|
|
Parameters:
API Tags:
See: | GalleryCoreApi::fetchAccessListId |
void fetchAllPermissionsForItem(
$itemId, [
$compress = false]
)
|
|
Parameters:
API Tags:
See: | GalleryCoreApi::fetchAllPermissionsForItem |
void getPermissionIds(
[
$flags = 0]
)
|
|
Parameters:
API Tags:
See: | GalleryCoreApi::getPermissionIds |
void getSubPermissions(
$permissionId
)
|
|
Parameters:
API Tags:
See: | GalleryCoreApi::getSubPermissions |
void hasPermission(
$itemId,
$entityIds,
$permissions
)
|
|
Parameters:
|
$itemId: |
|
|
$entityIds: |
|
|
$permissions: |
|
API Tags:
See: | GalleryCoreApi::hasPermission |
void maybeCompactAccessLists(
)
|
|
API Tags:
See: | GalleryCoreApi::maybeCompactAccessLists |
void registerPermission(
$module,
$permissionId,
$description, [
$flags = 0], [
$composites = array()]
)
|
|
Parameters:
|
$module: |
|
|
$permissionId: |
|
|
$description: |
|
|
$flags: |
|
|
$composites: |
|
API Tags:
See: | GalleryCoreApi::registerPermission |
void removeEntityPermission(
$itemId,
$entityId,
$permission, [
$applyToChildren = false]
)
|
|
Parameters:
|
$itemId: |
|
|
$entityId: |
|
|
$permission: |
|
|
$applyToChildren: |
|
API Tags:
See: | GalleryCoreApi::removeEntityPermission |
void removeGroupPermission(
$itemId,
$groupId,
$permission, [
$applyToChildren = false]
)
|
|
Parameters:
|
$itemId: |
|
|
$groupId: |
|
|
$permission: |
|
|
$applyToChildren: |
|
API Tags:
See: | GalleryCoreApi::removeGroupPermission |
void removeItemPermissions(
$itemId
)
|
|
Parameters:
API Tags:
See: | GalleryCoreApi::removeItemPermissions |
void removeUserPermission(
$itemId,
$userId,
$permission, [
$applyToChildren = false]
)
|
|
Parameters:
|
$itemId: |
|
|
$userId: |
|
|
$permission: |
|
|
$applyToChildren: |
|
API Tags:
See: | GalleryCoreApi::removeUserPermission |
void unregisterModulePermissions(
$moduleId
)
|
|
Parameters:
API Tags:
See: | GalleryCoreApi::unregisterModulePermissions |
GalleryStatus _changePermission(
string
$changeType, int
$itemId, int
$entityId, int
$permission, bool
$applyToChildren, [array
$removeEventIds = null]
)
|
|
Make the appropriate permission change.
Parameters:
string |
$changeType: |
the type of change ('add' or 'remove') |
int |
$itemId: |
the id of the GalleryItem |
int |
$entityId: |
the id of the GalleryEntity (usually GalleryUser or GalleryGroup) |
int |
$permission: |
the permission id |
bool |
$applyToChildren: |
whether or not this call applies to child items |
array |
$removeEventIds: |
(optional) base event data for Gallery::RemovePermission event |
API Tags:
Return: | a status code |
Access: | private |
array _copyAccessList(
int
$oldAccessListId
)
|
|
Create a duplicate access list.
Parameters:
int |
$oldAccessListId: |
the id of the source access list |
API Tags:
Return: | GalleryStatus a status code, int AccessListId the new access list's id |
Access: | private |
array _fetchPermissionBitsForItem(
int
$itemId, int
$userOrGroupId
)
|
|
Return a permissions for the given item
Parameters:
int |
$itemId: |
GalleryItem id |
int |
$userOrGroupId: |
user id or group id |
API Tags:
Return: | GalleryStatus a status code int permissions or null if not found |
Access: | private |
array _getAccessListCompacterLock(
string
$type
)
|
|
Acquire a read or write lock on our access list compacter semaphore. While we have this read lock, the access list can't be compacted. While we have a write lock, we're in the process of compacting so nobody else should be touching the access map.
Parameters:
string |
$type: |
'read' or 'write' |
API Tags:
Return: | GalleryStatus a status code int lock id |
Access: | private |
array _newPermissionBit(
)
|
|
Return an unused permission bit that we can use for our purposes
API Tags:
Return: | GalleryStatus a status code int location of a bit (1, 2, 3, etc) |
Access: | private |
GalleryStatus _postGroupEvent(
int
$groupId, mixed
$itemId, string
$permission, boolean
$applyToChildren, string
$changeType
)
|
|
Post Gallery::ViewableTreeChange event for change of group permissions.
Parameters:
int |
$groupId: |
|
mixed |
$itemId: |
item id or array of ids |
string |
$permission: |
the permission id |
boolean |
$applyToChildren: |
whether or not this call applies to child items |
string |
$changeType: |
the type of change ('add' or 'remove') |
API Tags:
Return: | a status code |
Access: | private |
GalleryStatus _removePermissionsFromAllItems(
array
$permissionIds
)
|
|
Remove the given permissions from all items. Useful when we remove a permission from the system.
Parameters:
array |
$permissionIds: |
permission ids |
API Tags:
Add a permission to the database and to our permission cache.
Parameters:
array |
$data: |
the specific permission data |
API Tags:
Return: | a status code |
Access: | private |
|
|