All Data Structures Functions Variables Pages
Static Public Member Functions | Static Protected Member Functions
AllPermissionsOptimizationUtil Class Reference

Static Public Member Functions

static checkPermissionsHasAnyOf ($requiredPermissions, OwnedSecurableItem $ownedSecurableItem, User $user)
 
static rebuild ($overwriteExistingTables=true, $forcePhp=false, $messageStreamer=null)
 
static ownedSecurableItemCreated (OwnedSecurableItem $ownedSecurableItem)
 
static ownedSecurableItemOwnerChanged (OwnedSecurableItem $ownedSecurableItem, User $oldUser=null)
 
static securableItemBeingDeleted (SecurableItem $securableItem)
 
static securableItemGivenPermissionsForUser (SecurableItem $securableItem, User $user)
 
static securableItemGivenPermissionsForGroup (SecurableItem $securableItem, Group $group)
 
static securableItemLostPermissionsForUser (SecurableItem $securableItem, User $user)
 
static securableItemLostPermissionsForGroup (SecurableItem $securableItem, Group $group)
 
static securableItemGivenReadPermissionsForUser (SecurableItem $securableItem, User $user)
 
static securableItemGivenReadPermissionsForGroup (SecurableItem $securableItem, Group $group)
 
static securableItemLostReadPermissionsForUser (SecurableItem $securableItem, User $user)
 
static securableItemLostReadPermissionsForGroup (SecurableItem $securableItem, Group $group)
 
static userBeingDeleted ($user)
 
static userAddedToGroup (Group $group, User $user)
 
static userRemovedFromGroup (Group $group, User $user)
 
static groupAddedToGroup (Group $group)
 
static groupBeingRemovedFromGroup (Group $group)
 
static groupBeingDeleted ($group)
 
static roleParentSet (Role $role)
 
static roleParentBeingRemoved (Role $role)
 
static roleBeingDeleted (Role $role)
 
static userAddedToRole (User $user)
 
static userBeingRemovedFromRole (User $user, Role $role)
 
static getAllUpstreamGroupsRecursively (Group $group, &$groupMungeIds)
 
static getMungeIdsByUser (User $user)
 

Static Protected Member Functions

static resolveAndCheckPermissionsForRead ($requiredPermissions, OwnedSecurableItem $ownedSecurableItem, User $user)
 
static checkPermissionsHasRead ($requiredPermissions, OwnedSecurableItem $ownedSecurableItem, User $user)
 
static getUserRoleIdAndGroupIds (User $user)
 

Detailed Description

Helper class for working with all permission optimizations. (Munge)

Definition at line 40 of file AllPermissionsOptimizationUtil.php.

Member Function Documentation

static checkPermissionsHasAnyOf (   $requiredPermissions,
OwnedSecurableItem  $ownedSecurableItem,
User  $user 
)
static

Performance booster to replace constant calls to getEffectivePermissions. While getEffectivePermissions does make use of cache, in scenarios with complex nested roles and groups, the initial call to get the effective permissions for a given user can take a long time. This is true with securityOptimization = true and when false. This utility makes use of the existing munge 'read' tables already in place that can give accurate permission information at the atomic 'model' level.

Parameters
$requiredPermissions
OwnedSecurableItem$ownedSecurableItem
User$user
Returns
bool

Definition at line 53 of file AllPermissionsOptimizationUtil.php.

static resolveAndCheckPermissionsForRead (   $requiredPermissions,
OwnedSecurableItem  $ownedSecurableItem,
User  $user 
)
staticprotected
Parameters
$requiredPermissions
OwnedSecurableItem$ownedSecurableItem
User$user
Returns
bool
Exceptions
AccessDeniedSecurityException

Definition at line 93 of file AllPermissionsOptimizationUtil.php.

static checkPermissionsHasRead (   $requiredPermissions,
OwnedSecurableItem  $ownedSecurableItem,
User  $user 
)
staticprotected
Parameters
$requiredPermissions
OwnedSecurableItem$ownedSecurableItem
User$user
Returns
bool
Exceptions
NotSupportedException
AccessDeniedSecurityException

Definition at line 134 of file AllPermissionsOptimizationUtil.php.

static rebuild (   $overwriteExistingTables = true,
  $forcePhp = false,
  $messageStreamer = null 
)
static
Parameters
bool$overwriteExistingTables
bool$forcePhp
null$messageStreamer

Definition at line 179 of file AllPermissionsOptimizationUtil.php.

static ownedSecurableItemCreated ( OwnedSecurableItem  $ownedSecurableItem)
static
Parameters
OwnedSecurableItem$ownedSecurableItem

Definition at line 187 of file AllPermissionsOptimizationUtil.php.

static ownedSecurableItemOwnerChanged ( OwnedSecurableItem  $ownedSecurableItem,
User  $oldUser = null 
)
static
Parameters
OwnedSecurableItem$ownedSecurableItem
User$oldUser

Definition at line 196 of file AllPermissionsOptimizationUtil.php.

static securableItemBeingDeleted ( SecurableItem  $securableItem)
static
Parameters
SecurableItem$securableItem

Definition at line 205 of file AllPermissionsOptimizationUtil.php.

static securableItemGivenPermissionsForUser ( SecurableItem  $securableItem,
User  $user 
)
static
Parameters
SecurableItem$securableItem
User$user

Definition at line 215 of file AllPermissionsOptimizationUtil.php.

static securableItemGivenPermissionsForGroup ( SecurableItem  $securableItem,
Group  $group 
)
static
Parameters
SecurableItem$securableItem
Group$group

Definition at line 224 of file AllPermissionsOptimizationUtil.php.

static securableItemLostPermissionsForUser ( SecurableItem  $securableItem,
User  $user 
)
static
Parameters
SecurableItem$securableItem
User$user

Definition at line 233 of file AllPermissionsOptimizationUtil.php.

static securableItemLostPermissionsForGroup ( SecurableItem  $securableItem,
Group  $group 
)
static
Parameters
SecurableItem$securableItem
Group$group

Definition at line 242 of file AllPermissionsOptimizationUtil.php.

static securableItemGivenReadPermissionsForUser ( SecurableItem  $securableItem,
User  $user 
)
static
Parameters
SecurableItem$securableItem
User$user

Definition at line 251 of file AllPermissionsOptimizationUtil.php.

static securableItemGivenReadPermissionsForGroup ( SecurableItem  $securableItem,
Group  $group 
)
static
Parameters
SecurableItem$securableItem
Group$group

Definition at line 261 of file AllPermissionsOptimizationUtil.php.

static securableItemLostReadPermissionsForUser ( SecurableItem  $securableItem,
User  $user 
)
static
Parameters
SecurableItem$securableItem
User$user

Definition at line 271 of file AllPermissionsOptimizationUtil.php.

static securableItemLostReadPermissionsForGroup ( SecurableItem  $securableItem,
Group  $group 
)
static
Parameters
SecurableItem$securableItem
Group$group

Definition at line 281 of file AllPermissionsOptimizationUtil.php.

static userBeingDeleted (   $user)
static
Parameters
$user

Definition at line 290 of file AllPermissionsOptimizationUtil.php.

static userAddedToGroup ( Group  $group,
User  $user 
)
static
Parameters
Group$group
User$user

Definition at line 300 of file AllPermissionsOptimizationUtil.php.

static userRemovedFromGroup ( Group  $group,
User  $user 
)
static
Parameters
Group$group
User$user

Definition at line 310 of file AllPermissionsOptimizationUtil.php.

static groupAddedToGroup ( Group  $group)
static
Parameters
Group$group

Definition at line 319 of file AllPermissionsOptimizationUtil.php.

static groupBeingRemovedFromGroup ( Group  $group)
static
Parameters
Group$group

Definition at line 328 of file AllPermissionsOptimizationUtil.php.

static groupBeingDeleted (   $group)
static
Parameters
$group

Definition at line 337 of file AllPermissionsOptimizationUtil.php.

static roleParentSet ( Role  $role)
static
Parameters
Role$role

Definition at line 346 of file AllPermissionsOptimizationUtil.php.

static roleParentBeingRemoved ( Role  $role)
static
Parameters
Role$role

Definition at line 355 of file AllPermissionsOptimizationUtil.php.

static roleBeingDeleted ( Role  $role)
static
Parameters
Role$role

Definition at line 364 of file AllPermissionsOptimizationUtil.php.

static userAddedToRole ( User  $user)
static
Parameters
User$user

Definition at line 373 of file AllPermissionsOptimizationUtil.php.

static userBeingRemovedFromRole ( User  $user,
Role  $role 
)
static
Parameters
User$user
Role$role

Definition at line 383 of file AllPermissionsOptimizationUtil.php.

static getAllUpstreamGroupsRecursively ( Group  $group,
$groupMungeIds 
)
static
Parameters
Group$group
$groupMungeIds

Definition at line 393 of file AllPermissionsOptimizationUtil.php.

static getMungeIdsByUser ( User  $user)
static
Parameters
User$user
Returns
array

Definition at line 402 of file AllPermissionsOptimizationUtil.php.

static getUserRoleIdAndGroupIds ( User  $user)
staticprotected
Parameters
User$user
Returns
array

Definition at line 435 of file AllPermissionsOptimizationUtil.php.


The documentation for this class was generated from the following file:
Generated on Wed Apr 8 2020 07:10:48