SecurableItem Class Reference

Inheritance diagram for SecurableItem:
Item CustomFieldsModel RedBeanModel BeanModel ObservableComponent NamedSecurableItem OwnedSecurableItem Account Activity ApiTestModelItem ApiTestModelItem2 ApiTestModelItem3 ApiTestModelItem4 Campaign ContactWebForm Conversation Dashboard EmailMessage EmailTemplate EmailTemplateModelTestItem ExportItem ExportTestModelItem ExportTestModelItem2 ExportTestModelItem3 ExportTestModelItem4 ExportTestModelItem5 GameReward ImportDedupeModelTestItem ImportModelTestItem ImportModelTestItem2 ImportModelTestItem3 ImportModelTestItem4 ImportModelTestItem5 MarketingList Mission ModelToArrayAdapterTestItem ModelToArrayAdapterTestItem2 ModelToArrayAdapterTestItem3 ModelToArrayAdapterTestItem4 Opportunity OwnedSecurableTestItem OwnedSecurableTestItem2 Person Product Project ReportModelTestItem ReportModelTestItem10 ReportModelTestItem2 ReportModelTestItem3 ReportModelTestItem4 ReportModelTestItem5 ReportModelTestItem6 ReportModelTestItem7 ReportModelTestItem8 ReportModelTestItem9 SavedCalendar SavedReport SavedSearch SocialItem WorkflowModelTestItem WorkflowModelTestItem2 WorkflowModelTestItem3 WorkflowModelTestItem4 WorkflowModelTestItem5 WorkflowModelTestItem6 WorkflowModelTestItem7 WorkflowModelTestItem8 WorkflowModelTestItem9

Public Member Functions

 getExplicitReadWriteModelPermissionsForWorkflow ()
 setExplicitReadWriteModelPermissionsForWorkflow (ExplicitReadWriteModelPermissions $permissions)
 clearExplicitReadWriteModelPermissionsForWorkflow ()
 getEffectivePermissions ($permitable=null)
 getActualPermissions ($permitable=null)
 getPropagatedActualAllowPermissions (Permitable $permitable)
 getExplicitActualPermissions ($permitable=null)
 getInheritedActualPermissions ($permitable=null)
 addPermissions (Permitable $permitable, $permissions, $type=Permission::ALLOW)
 removePermissions (Permitable $permitable, $permissions=Permission::ALL, $type=Permission::ALLOW_DENY)
 removeAllPermissions ()
 __get ($attributeName)
 __set ($attributeName, $value)
 delete ()
 addPermitableToAttachAfterSave (Permitable $permitable, $checkDetachBeforeAddition=false)
 removePermitableFromPermitablesToAttachAfterSave (Permitable $permitable)
 addPermitableToDetachAfterSave (Permitable $permitable, $checkAttachBeforeAddition=false)
 removePermitableFromPermitablesToDetachAfterSave (Permitable $permitable)

Static Public Member Functions

static getDefaultMetadata ()
static isTypeDeletable ()
static hasReadPermissionsOptimization ()

Protected Member Functions

 recursiveGetPropagatedAllowPermissions ($role)
 getAllDescendentRoles ($role)
 checkPermissionsHasAnyOf ($requiredPermissions)
 afterSave ()
 resolvePermitablesToUpdate ()
 updatePermitables (ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions)
 isPermitableUpdateRequired (ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions)
 resolveRelativePermitablesToBeUpdated (ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions)
 resolvePermitablesToAttach (ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions)
 resolvePermitablesToDetach (ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions)

Detailed Description

Definition at line 37 of file SecurableItem.php.


Member Function Documentation

getActualPermissions ( permitable = null  ) 
Parameters:
null|Permitable $permitable
Returns:
array
Exceptions:
NoCurrentUserSecurityException 

Reimplemented in NamedSecurableItem, and OwnedSecurableItem.

Definition at line 87 of file SecurableItem.php.

addPermissions ( Permitable permitable,
permissions,
type = Permission::ALLOW 
)
Parameters:
Permitable $permitable
int $permissions
array $type
Returns:
bool true/false if permissions was added. if false, the the permission already existed

Definition at line 335 of file SecurableItem.php.

removePermissions ( Permitable permitable,
permissions = Permission::ALL,
type = Permission::ALLOW_DENY 
)
Parameters:
Permitable $permitable
int $permissions
array $type

Definition at line 381 of file SecurableItem.php.

__get ( attributeName  ) 

Exposes the members and relations of the model as if they were actual attributes of the model. See __set().

Parameters:
$attributeName A non-empty string that is the name of a member or relation.
See also:
attributeNames()
Returns:
A value or model of the type specified as valid for the member or relation by the meta data supplied by the extending class's getMetadata() method.

Reimplemented from RedBeanModel.

Reimplemented in NamedSecurableItem.

Definition at line 426 of file SecurableItem.php.

__set ( attributeName,
value 
)

Sets the members and relations of the model as if they were actual attributes of the model. For example, if Account extends RedBeanModel and its attributeNames() returns that one it has a member 'name' and a relation 'owner' they are simply accessed as:

   $account = new Account();
   $account->name = 'International Corp';
   $account->owner = User::getByUsername('bill');
   $account->save();
Parameters:
$attributeName A non-empty string that is the name of a member or relation of the model.
$value A value or model of the type specified as valid for the member or relation by the meta data supplied by the extending class's getMetadata() method.

Reimplemented from Item.

Reimplemented in EmailTemplate, and OwnedSecurableItem.

Definition at line 439 of file SecurableItem.php.

delete (  ) 

Deletes the model from the database.

Reimplemented from Item.

Definition at line 456 of file SecurableItem.php.

checkPermissionsHasAnyOf ( requiredPermissions  )  [protected]
Parameters:
int $requiredPermissions
Exceptions:
AccessDeniedSecurityException 

Reimplemented in NamedSecurableItem.

Definition at line 466 of file SecurableItem.php.

static getDefaultMetadata (  )  [static]
static isTypeDeletable (  )  [static]

To be overriden on intermediate derived classes to return false so that deletes are not done on intermediate classes because the object relational mapping will not clean up properly. For example if User is a Person, and Person is a RedBeanModel delete should be called only on User, not on Person. So User must override isDeletable to return false.

Reimplemented from Item.

Reimplemented in Account, Activity, ApiTestModelItem, ApiTestModelItem2, ApiTestModelItem3, ApiTestModelItem4, SavedCalendar, Campaign, Contact, ContactWebForm, Conversation, EmailMessage, EmailTemplate, EmailTemplateModelTestItem, ExportItem, ExportTestModelItem, ExportTestModelItem2, ExportTestModelItem3, ExportTestModelItem4, ExportTestModelItem5, GameReward, Dashboard, ImportDedupeModelTestItem, ImportModelTestItem, ImportModelTestItem2, ImportModelTestItem3, ImportModelTestItem4, ImportModelTestItem5, MarketingList, Meeting, Mission, Note, Opportunity, Product, Project, SavedReport, ReportModelTestItem, ReportModelTestItem10, ReportModelTestItem2, ReportModelTestItem3, ReportModelTestItem4, ReportModelTestItem5, ReportModelTestItem6, ReportModelTestItem7, ReportModelTestItem8, ReportModelTestItem9, SocialItem, Task, WorkflowModelTestItem, WorkflowModelTestItem2, WorkflowModelTestItem3, WorkflowModelTestItem4, WorkflowModelTestItem5, WorkflowModelTestItem6, WorkflowModelTestItem7, WorkflowModelTestItem8, WorkflowModelTestItem9, NamedSecurableItem, OwnedSecurableItem, Person, SavedSearch, ModelToArrayAdapterTestItem, ModelToArrayAdapterTestItem2, ModelToArrayAdapterTestItem3, ModelToArrayAdapterTestItem4, and OwnedSecurableTestItem.

Definition at line 488 of file SecurableItem.php.

afterSave (  )  [protected]

Handle Permitable Attachment/Detachment after model has been saved.

Reimplemented from Item.

Reimplemented in Campaign, ExportItem, Mission, Project, Task, and OwnedSecurableItem.

Definition at line 504 of file SecurableItem.php.

resolvePermitablesToUpdate (  )  [protected]

Resolve Permitables to be updated, save model again if required.

Definition at line 513 of file SecurableItem.php.

updatePermitables ( ExplicitReadWriteModelPermissions explicitReadWriteModelPermissions  )  [protected]

Updates permitables for current model.

Parameters:
ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions
Returns:
bool
Exceptions:
NotSupportedException 

Definition at line 529 of file SecurableItem.php.

isPermitableUpdateRequired ( ExplicitReadWriteModelPermissions explicitReadWriteModelPermissions  )  [protected]

Return true/false depending on if we need to update Permitables or not.

Parameters:
ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions
Returns:
bool

Definition at line 548 of file SecurableItem.php.

resolveRelativePermitablesToBeUpdated ( ExplicitReadWriteModelPermissions explicitReadWriteModelPermissions  )  [protected]

Resolves relative _permitablesToDetachAfterSave and _permitablesToAttachAfterSave. _permitablesToDetachAfterSave is rid of items that exist in _permitablesToAttachAfterSave too. _permitablesToAttachAfterSave is rid of items that are already attached to model due to previous save.

Parameters:
ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions

Definition at line 559 of file SecurableItem.php.

resolvePermitablesToAttach ( ExplicitReadWriteModelPermissions explicitReadWriteModelPermissions  )  [protected]

Add desired RW permitables to model, reset the _permitablesToAttachAfterSave array once done.

Parameters:
ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions

Definition at line 576 of file SecurableItem.php.

resolvePermitablesToDetach ( ExplicitReadWriteModelPermissions explicitReadWriteModelPermissions  )  [protected]

Remove desired RW permitables from model, reset the _permitablesToDetachAfterSave array once done.

Parameters:
ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions

Definition at line 590 of file SecurableItem.php.

addPermitableToAttachAfterSave ( Permitable permitable,
checkDetachBeforeAddition = false 
)

Add a permitable to list of permitables to be attached on model's afterSave checkDetachBeforeAddition ensures that we do not have same permitable in attachment as well as detachment. If found in detachment list, it is removed from there.

Parameters:
Permitable $permitable
bool $checkDetachBeforeAddition

Definition at line 607 of file SecurableItem.php.

removePermitableFromPermitablesToAttachAfterSave ( Permitable permitable  ) 

Remove a permitable from the list of permitables to be attached on model's afterSave

Parameters:
Permitable $permitable
Returns:
bool

Definition at line 620 of file SecurableItem.php.

addPermitableToDetachAfterSave ( Permitable permitable,
checkAttachBeforeAddition = false 
)

Add a permitable to list of permitables to be detached on model's afterSave checkAttachBeforeAddition ensures that we do not have same permitable in detachment as well as attachment. If found in attachment list, it is removed from there.

Parameters:
Permitable $permitable
bool $checkAttachBeforeAddition

Definition at line 638 of file SecurableItem.php.

removePermitableFromPermitablesToDetachAfterSave ( Permitable permitable  ) 

Remove a permitable from the list of permitables to be detached on model's afterSave

Parameters:
Permitable $permitable
Returns:
bool

Definition at line 651 of file SecurableItem.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Wed Sep 20 07:10:28 2017