Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
Static Public Member Functions | Data Fields | Static Protected Member Functions
ExplicitReadWriteModelPermissionsUtil Class Reference

Static Public Member Functions

static makeByMixedPermitablesData ($mixedPermitablesData)
 
static makeMixedPermitablesDataByExplicitReadWriteModelPermissions ($explicitReadWriteModelPermissions)
 
static makeByPostData ($postData)
 
static resolveByPostDataAndModelThenMake ($postData, SecurableItem $securableItem)
 
static removeIfExistsFromPostData ($postData)
 
static resolveExplicitReadWriteModelPermissions (SecurableItem $securableItem, ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions, $validate=false)
 
static resolveExplicitReadWriteModelPermissionsForDisplay (SecurableItem $securableItem, ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions)
 
static makeBySecurableItem (SecurableItem $securableItem)
 

Data Fields

const MIXED_TYPE_EVERYONE_GROUP = 1
 
const MIXED_TYPE_NONEVERYONE_GROUP = 2
 

Static Protected Member Functions

static resolveForDifferencesBySecurableItem ($explicitReadWriteModelPermissions, SecurableItem $securableItem)
 

Detailed Description

Helper class for managing the explicit setting of permissions against a model in the user interface.

See Also
ExplicitReadWriteModelPermissions
ExplicitReadWriteModelPermissionsElement

Definition at line 42 of file ExplicitReadWriteModelPermissionsUtil.php.

Member Function Documentation

static makeByMixedPermitablesData (   $mixedPermitablesData)
static

Given a mixed permitables data array, make a explicitReadWriteModelPermissions object. The $mixedPermitablesData is an array with 2 sub-arrays. readOnly and readWrite. These sub-arrays each contain an array of permitable objects.

Parameters
array$mixedPermitablesData

Definition at line 62 of file ExplicitReadWriteModelPermissionsUtil.php.

static makeMixedPermitablesDataByExplicitReadWriteModelPermissions (   $explicitReadWriteModelPermissions)
static

Given a explicitReadWriteModelPermissions object, make a $mixedPermitablesData array.

Parameters
ExplicitReadWriteModelPermissions$explicitReadWriteModelPermissions

Definition at line 87 of file ExplicitReadWriteModelPermissionsUtil.php.

static makeByPostData (   $postData)
static

Given post data, which would be coming most likely from the ExplicitReadWriteModelPermissionsElement, transform the post data into a ExplicitReadWriteModelPermissions object. If the post data contains a 'type' value that is not supported, an exception is thrown.

Parameters
array$postData
See Also
ExplicitReadWriteModelPermissionsElement

Definition at line 122 of file ExplicitReadWriteModelPermissionsUtil.php.

static resolveByPostDataAndModelThenMake (   $postData,
SecurableItem  $securableItem 
)
static

Given an array of post data and a securable item, if the post data has the 'explicitReadWriteModelPermissions' present, then make a explicitReadWriteModelPermissions from that data and then resolve against any differences in the securable item. This means if the post data says a group is read/write, but the existing securable item does not have that, then this signals this will need to be added. Whereas if the securable item has a read/write group that the post data does not have, this signals that this read/write needs to be removed.

Parameters
array$postData
SecurableItem$securableItem

Definition at line 158 of file ExplicitReadWriteModelPermissionsUtil.php.

static resolveForDifferencesBySecurableItem (   $explicitReadWriteModelPermissions,
SecurableItem  $securableItem 
)
staticprotected

If the ExplicitReadWriteModelPermissions says a group is read/write, but the existing securable item does not have that, then this signals this group will need to be added. Whereas if the securable item has a read/write group that the ExplicitReadWriteModelPermissions does not have, this signals that this read/write needs to be removed.

Parameters
ExplicitReadWriteModelPermissions$explicitReadWriteModelPermissions
SecurableItem$securableItem

Definition at line 181 of file ExplicitReadWriteModelPermissionsUtil.php.

static removeIfExistsFromPostData (   $postData)
static

Unset the 'explicitReadWriteModelPermissions' array of data in a post data array if it exists.

Parameters
array$postData
Returns
array of post data with the 'explicitReadWriteModelPermissions' removed.

Definition at line 213 of file ExplicitReadWriteModelPermissionsUtil.php.

static resolveExplicitReadWriteModelPermissions ( SecurableItem  $securableItem,
ExplicitReadWriteModelPermissions  $explicitReadWriteModelPermissions,
  $validate = false 
)
static

Given a SecurableItem, add and remove permissions based on what the provided ExplicitReadWriteModelPermissions indicates should be done. Sets

See Also
SecurableItem->setTreatCurrentUserAsOwnerForPermissions as true in order to ensure the current user can effectively add permissions even if the current user is no longer the owner.
Parameters
SecurableItem$securableItem
ExplicitReadWriteModelPermissions$explicitReadWriteModelPermissions
bool$validate
Returns
bool|void
Exceptions
NotSupportedException

Definition at line 234 of file ExplicitReadWriteModelPermissionsUtil.php.

static resolveExplicitReadWriteModelPermissionsForDisplay ( SecurableItem  $securableItem,
ExplicitReadWriteModelPermissions  $explicitReadWriteModelPermissions 
)
static

Given a SecurableItem, add and remove permissions just on the securableItem. Since this method is called when the SecurableItem is not being saved and just for display purposes in the user interface.

Parameters
SecurableItem$securableItem
ExplicitReadWriteModelPermissions$explicitReadWriteModelPermissions
Returns
boolean
Exceptions
NotSupportedException()

Definition at line 377 of file ExplicitReadWriteModelPermissionsUtil.php.

static makeBySecurableItem ( SecurableItem  $securableItem)
static

Make an ExplicitReadWriteModelPermissions by SecurableItem.

Parameters
SecurableItem$securableItem

Definition at line 402 of file ExplicitReadWriteModelPermissionsUtil.php.


The documentation for this class was generated from the following file:
Generated on Tue Sep 22 2020 07:10:47
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.