phpDocumentor GalleryCore
Helpers
[ class tree: GalleryCore ] [ index: GalleryCore ] [ all elements ]

Class: GalleryPermissionHelper_advanced

Source Location: /modules/core/classes/helpers/GalleryPermissionHelper_advanced.class

Class GalleryPermissionHelper_advanced

Method Summary
void   addEntityPermission()  
void   addGroupPermission()  
void   addUserPermission()  
void   compactAccessLists()  
void   copyPermissions()  
void   fetchAccessListId()  
void   fetchAllPermissionsForItem()  
void   getPermissionIds()  
void   getSubPermissions()  
void   hasPermission()  
void   maybeCompactAccessLists()  
void   registerPermission()  
void   removeEntityPermission()  
void   removeGroupPermission()  
void   removeItemPermissions()  
void   removeUserPermission()  
void   unregisterModulePermissions()  
GalleryStatus   _changePermission()   Make the appropriate permission change.
array   _copyAccessList()   Create a duplicate access list.
array   _fetchPermissionBitsForItem()   Return a permissions for the given item
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
GalleryStatus   _postGroupEvent()   Post Gallery::ViewableTreeChange event for change of group permissions.
GalleryStatus   _removePermissionsFromAllItems()   Remove the given permissions from all items. Useful when we remove a permission from the system.
GalleryStatus   _setPermission()   Add a permission to the database and to our permission cache.

[ Top ]
Methods
addEntityPermission  [line 121]

  void addEntityPermission( $itemId, $entityId, $permission, [ $applyToChildren = false]  )

Parameters:
   $itemId: 
   $entityId: 
   $permission: 
   $applyToChildren: 

API Tags:
See:  GalleryCoreApi::addEntityPermission


[ Top ]
addGroupPermission  [line 64]

  void addGroupPermission( $itemId, $groupId, $permission, [ $applyToChildren = false]  )

Parameters:
   $itemId: 
   $groupId: 
   $permission: 
   $applyToChildren: 

API Tags:
See:  GalleryCoreApi::addGroupPermission


[ Top ]
addUserPermission  [line 42]

  void addUserPermission( $itemId, $userId, $permission, [ $applyToChildren = false]  )

Parameters:
   $itemId: 
   $userId: 
   $permission: 
   $applyToChildren: 

API Tags:
See:  GalleryCoreApi::addUserPermission


[ Top ]
compactAccessLists  [line 1091]

  void compactAccessLists( )


API Tags:
See:  GalleryCoreApi::compactAccessLists


[ Top ]
copyPermissions  [line 659]

  void copyPermissions( $toId, $fromId  )

Parameters:
   $toId: 
   $fromId: 

API Tags:
See:  GalleryCoreApi::copyPermissions


[ Top ]
fetchAccessListId  [line 596]

  void fetchAccessListId( $itemId  )

Parameters:
   $itemId: 

API Tags:
See:  GalleryCoreApi::fetchAccessListId


[ Top ]
fetchAllPermissionsForItem  [line 499]

  void fetchAllPermissionsForItem( $itemId, [ $compress = false]  )

Parameters:
   $itemId: 
   $compress: 

API Tags:
See:  GalleryCoreApi::fetchAllPermissionsForItem


[ Top ]
getPermissionIds  [line 816]

  void getPermissionIds( [ $flags = 0]  )

Parameters:
   $flags: 

API Tags:
See:  GalleryCoreApi::getPermissionIds


[ Top ]
getSubPermissions  [line 837]

  void getSubPermissions( $permissionId  )

Parameters:
   $permissionId: 

API Tags:
See:  GalleryCoreApi::getSubPermissions


[ Top ]
hasPermission  [line 697]

  void hasPermission( $itemId, $entityIds, $permissions  )

Parameters:
   $itemId: 
   $entityIds: 
   $permissions: 

API Tags:
See:  GalleryCoreApi::hasPermission


[ Top ]
maybeCompactAccessLists  [line 1077]

  void maybeCompactAccessLists( )


API Tags:
See:  GalleryCoreApi::maybeCompactAccessLists


[ Top ]
registerPermission  [line 751]

  void registerPermission( $module, $permissionId, $description, [ $flags = 0], [ $composites = array()]  )

Parameters:
   $module: 
   $permissionId: 
   $description: 
   $flags: 
   $composites: 

API Tags:
See:  GalleryCoreApi::registerPermission


[ Top ]
removeEntityPermission  [line 177]

  void removeEntityPermission( $itemId, $entityId, $permission, [ $applyToChildren = false]  )

Parameters:
   $itemId: 
   $entityId: 
   $permission: 
   $applyToChildren: 

API Tags:
See:  GalleryCoreApi::removeEntityPermission


[ Top ]
removeGroupPermission  [line 157]

  void removeGroupPermission( $itemId, $groupId, $permission, [ $applyToChildren = false]  )

Parameters:
   $itemId: 
   $groupId: 
   $permission: 
   $applyToChildren: 

API Tags:
See:  GalleryCoreApi::removeGroupPermission


[ Top ]
removeItemPermissions  [line 450]

  void removeItemPermissions( $itemId  )

Parameters:
   $itemId: 

API Tags:
See:  GalleryCoreApi::removeItemPermissions


[ Top ]
removeUserPermission  [line 134]

  void removeUserPermission( $itemId, $userId, $permission, [ $applyToChildren = false]  )

Parameters:
   $itemId: 
   $userId: 
   $permission: 
   $applyToChildren: 

API Tags:
See:  GalleryCoreApi::removeUserPermission


[ Top ]
unregisterModulePermissions  [line 855]

  void unregisterModulePermissions( $moduleId  )

Parameters:
   $moduleId: 

API Tags:
See:  GalleryCoreApi::unregisterModulePermissions


[ Top ]
_changePermission  [line 199]

  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


[ Top ]
_copyAccessList  [line 621]

  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


[ Top ]
_fetchPermissionBitsForItem  [line 559]

  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


[ Top ]
_getAccessListCompacterLock  [line 1036]

  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


[ Top ]
_newPermissionBit  [line 897]

  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


[ Top ]
_postGroupEvent  [line 91]

  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


[ Top ]
_removePermissionsFromAllItems  [line 973]

  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:
Return:  a status code


[ Top ]
_setPermission  [line 946]

  GalleryStatus _setPermission( array $data  )

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


[ Top ]

Documentation generated on Fri, 08 Oct 2010 05:01:30 -0700 by phpDocumentor 1.3.0RC6