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 ExportTestModelItem6 GameReward ImportDedupeModelTestItem ImportModelTestItem ImportModelTestItem2 ImportModelTestItem3 ImportModelTestItem4 ImportModelTestItem5 MarketingList Mission ModelToArrayAdapterTestItem ModelToArrayAdapterTestItem2 ModelToArrayAdapterTestItem3 ModelToArrayAdapterTestItem4 Opportunity OwnedSecurableTestItem OwnedSecurableTestItem2 OwnedSecurableTestItem3 Person Product Project ReportModelTestItem ReportModelTestItem10 ReportModelTestItem12 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)
 processGetActualPermissionsAsNonOptimized ()
 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 ()
 checkPermissionsHasAnyOf ($requiredPermissions, User $user=null)
 addPermitableToAttachAfterSave (Permitable $permitable, $checkDetachBeforeAddition=false)
 removePermitableFromPermitablesToAttachAfterSave (Permitable $permitable)
 addPermitableToDetachAfterSave (Permitable $permitable, $checkAttachBeforeAddition=false)
 removePermitableFromPermitablesToDetachAfterSave (Permitable $permitable)
 arePermissionsChanged ()

Static Public Member Functions

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

Protected Member Functions

 recursiveGetPropagatedAllowPermissions ($role)
 getAllDescendentRoles ($role)
 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 92 of file SecurableItem.php.

processGetActualPermissionsAsNonOptimized (  ) 

Override if you need to force the permissions to process non-optimized.

See also:
NamedSecurableItem
Returns:
bool

Reimplemented in NamedSecurableItem.

Definition at line 193 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 349 of file SecurableItem.php.

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

Definition at line 398 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 449 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, Task, and OwnedSecurableItem.

Definition at line 462 of file SecurableItem.php.

delete (  ) 

Deletes the model from the database.

Reimplemented from Item.

Definition at line 479 of file SecurableItem.php.

checkPermissionsHasAnyOf ( requiredPermissions,
User user = null 
)
Parameters:
int $requiredPermissions
Exceptions:
AccessDeniedSecurityException 

Reimplemented in EmailTemplate, NamedSecurableItem, and OwnedSecurableItem.

Definition at line 489 of file SecurableItem.php.

static getDefaultMetadata (  )  [static]

Returns the default meta data for the class. It must be appended to the meta data from the parent model, if any.

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, ExportTestModelItem6, GameReward, Dashboard, ImportDedupeModelTestItem, ImportModelTestItem, ImportModelTestItem2, ImportModelTestItem3, ImportModelTestItem4, ImportModelTestItem5, MarketingList, Meeting, Mission, Note, Opportunity, Product, Project, SavedReport, ReportModelTestItem, ReportModelTestItem10, ReportModelTestItem12, 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, OwnedSecurableTestItem, OwnedSecurableTestItem2, and OwnedSecurableTestItem3.

Definition at line 503 of file SecurableItem.php.

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, ExportTestModelItem6, GameReward, Dashboard, ImportDedupeModelTestItem, ImportModelTestItem, ImportModelTestItem2, ImportModelTestItem3, ImportModelTestItem4, ImportModelTestItem5, MarketingList, Meeting, Mission, Note, Opportunity, Product, Project, SavedReport, ReportModelTestItem, ReportModelTestItem10, ReportModelTestItem12, 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, OwnedSecurableTestItem, and OwnedSecurableTestItem3.

Definition at line 519 of file SecurableItem.php.

afterSave (  )  [protected]

Handle Permitable Attachment/Detachment after model has been saved.

Reimplemented from Item.

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

Definition at line 535 of file SecurableItem.php.

resolvePermitablesToUpdate (  )  [protected]

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

Definition at line 545 of file SecurableItem.php.

updatePermitables ( ExplicitReadWriteModelPermissions explicitReadWriteModelPermissions  )  [protected]

Updates permitables for current model.

Parameters:
ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions
Returns:
bool
Exceptions:
NotSupportedException 

Definition at line 561 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 580 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 591 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 608 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 622 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 639 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 652 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 670 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 683 of file SecurableItem.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Mon Oct 14 07:11:07 2019