All Data Structures Functions Variables Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions
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 ()
 
- Public Member Functions inherited from Item
 onCreated ()
 
 onModified ()
 
 __set ($attributeName, $value)
 
 delete ()
 
 save ($runValidation=true, array $attributeNames=null)
 
 addWorkflowToProcessAfterSave (Workflow $workflow)
 
 getWorkflowsToProcessAfterSave ()
 
 setDoNotProcessWorkflowOnSave ()
 
 setProcessWorkflowOnSave ()
 
 shouldProcessWorkflowOnSave ()
 
 forgetOriginalAttributeValues ()
 
 testBeforeDelete ()
 
 isAttributeAudited ($attributeName)
 
 isAllowedToSetReadOnlyAttribute ($attributeName)
 
- Public Member Functions inherited from RedBeanModel
 getIsNewModel ()
 
 __construct ($setDefaults=true, RedBean_OODBBean $bean=null, $forceTreatAsCreation=false, $runConstruction=true)
 
 serialize ()
 
 unserialize ($data)
 
 getPrimaryBean ()
 
 getClassId ($modelClassName)
 
 getClassBean ($modelClassName)
 
 getModelIdentifier ()
 
 castDown (array $derivedModelClassNames)
 
 isSame (RedBeanModel $model)
 
 __toString ()
 
 __get ($attributeName)
 
 __set ($attributeName, $value)
 
 __isset ($attributeName)
 
 __unset ($attributeName)
 
 attributeNames ()
 
 isAttribute ($attributeName)
 
 isAttributeWithLowerCaseConversion ($attributeName)
 
 isAttributeReadOnly ($attributeName)
 
 isAttributeFormattedAsProbability ($attributeName)
 
 isAllowedToSetReadOnlyAttribute ($attributeName)
 
 rules ()
 
 behaviors ()
 
 attributeLabels ()
 
 abbreviatedAttributeLabels ()
 
 validate (array $attributeNames=null, $ignoreRequiredValidator=false)
 
 onBeforeValidate (CModelEvent $event)
 
 onAfterValidate ($event)
 
 getValidatorList ()
 
 getValidators ($attributeName=null)
 
 forgetValidators ()
 
 createValidators ()
 
 isUniqueAttributeValue ($attributeName, $value)
 
 save ($runValidation=true, array $attributeNames=null)
 
 isRelatedModelReallyModified ($relatedModel, $relationType, $isOwned)
 
 isReallyModified ($relationType, $isOwned)
 
 onBeforeSave ($event)
 
 onAfterSave ($event)
 
 onRedBeanOneToManyRelatedModelsChange ($event)
 
 onBeforeDelete ($event)
 
 onAfterDelete ($event)
 
 isModified ()
 
 delete ()
 
 isDeleted ()
 
 isDeletable ()
 
 forget ()
 
 isAttributeRequired ($attributeName)
 
 isAttributeSafe ($attributeName)
 
 getAttributeLabel ($attributeName)
 
 getAttributeLabelsForAllActiveLanguagesByAttributeName ($attributeName)
 
 hasErrors ($attributeNameOrNames=null)
 
 getErrors ($attributeNameOrNames=null)
 
 getError ($attributeName)
 
 addError ($attributeName, $errorMessage)
 
 addErrors (array $errors)
 
 clearErrors ($attributeName=null)
 
 generateAttributeLabel ($attributeName)
 
 getAttributes (array $attributeNames=null)
 
 setAttributes (array $values, $safeOnly=true)
 
 unsetAttributes ($attributeNames=null)
 
 onUnsafeAttribute ($name, $value)
 
 getScenario ()
 
 setScenario ($scenarioName)
 
 getSafeAttributeNames ()
 
 getIterator ()
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $item)
 
 offsetUnset ($offset)
 
 stringifyOneToManyRelatedModelsValues ($values)
 
 setIsCopied ()
 
 isCopied ()
 
 addValidator ($attribute, $validator, $params=array())
 
- Public Member Functions inherited from ObservableComponent
 init ()
 
 attachEvents ($events)
 
 events ()
 
 attachEventHandler ($name, $handler)
 
 detachEventHandler ($name, $handler)
 

Static Public Member Functions

static getDefaultMetadata ()
 
static isTypeDeletable ()
 
static hasReadPermissionsOptimization ()
 
- Static Public Member Functions inherited from Item
static getDefaultMetadata ()
 
static isTypeDeletable ()
 
static getGamificationRulesType ()
 
static getNonConfigurableAttributes ()
 
static getByName ($name)
 
- Static Public Member Functions inherited from CustomFieldsModel
static getCanHaveBean ()
 
- Static Public Member Functions inherited from RedBeanModel
static model ($className=null)
 
static getAll ($orderBy=null, $sortDescending=false, $modelClassName=null)
 
static getSubset (RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter=null, $offset=null, $count=null, $where=null, $orderBy=null, $modelClassName=null, $selectDistinct=false)
 
static getSubsetIds (RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter=null, $offset=null, $count=null, $where=null, $orderBy=null, $modelClassName=null, $selectDistinct=false)
 
static makeSubsetOrCountSqlQuery ($tableName, RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter, $offset=null, $count=null, $where=null, $orderBy=null, $selectCount=false, $selectDistinct=false, array $quotedExtraSelectColumnNameAndAliases=array())
 
static getCount (RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter=null, $where=null, $modelClassName=null, $selectDistinct=false)
 
static getById ($id, $modelClassName=null)
 
static deleteAll ()
 
static mangleTableName ()
 
static getTableName ()
 
static getTableNames ($classNames)
 
static getForeignKeyName ($modelClassName, $relationName)
 
static getModelClassNameByIdentifier ($identifier)
 
static getMetadata ()
 
static canSaveMetadata ()
 
static setMetadata (array $metadata)
 
static getDefaultMetadata ()
 
static isTypeDeletable ()
 
static forgetAll ()
 
static getModelLabelByTypeAndLanguage ($type, $language=null)
 
static getAnAttributeLabel ($attributeName)
 
static makeModel (RedBean_OODBBean $bean, $modelClassName=null)
 
static makeModels (array $beans, $modelClassName=null)
 
static getModuleClassName ()
 
static getLastClassInBeanHeirarchy ()
 
static getSortAttributesByAttribute ($attribute)
 
static isCacheable ()
 
static getYiiValidatorsToRedBeanValidators ()
 
static getHasManyOpposingRelationName (RedBeanModel $model, $precedingModelClassName, $precedingRelation)
 
static relationLinksToPrecedingRelation ($modelClassName, $relation, $precedingModelClassName=null, $precedingRelation=null)
 
static allowMemcacheCache ()
 
- Static Public Member Functions inherited from BeanModel
static getCanHaveBean ()
 
static getMetadata ()
 
static isAnAttribute ($attributeName)
 
static resolveAttributeModelClassName ($attributeName)
 
static getAttributeModelClassName ($attributeName)
 
static isRelation ($attributeName)
 
static isOwnedRelation ($attributeName)
 
static getRelationType ($relationName)
 
static getRelationModelClassName ($relationName)
 
static getRelationLinkType ($relationName)
 
static getRelationLinkName ($relationName)
 
static isRelationTypeAHasManyVariant ($relationName)
 
static isRelationTypeAHasOneVariant ($relationName)
 
static isADerivedRelationViaCastedUpModel ($relationName)
 
static getDerivedRelationType ($relationName)
 
static getDerivedRelationModelClassName ($relationName)
 
static getDerivedRelationViaCastedUpModelOpposingRelationName ($relationName)
 
static getInferredRelationModelClassNamesForRelation ($relation)
 
static getColumnNameByAttribute ($attributeName)
 
static getAttributeNames ()
 
static generateAnAttributeLabel ($attributeName)
 
static getAbbreviatedAttributeLabel ($attributeName)
 
static getTranslatedAttributeLabels ($language)
 
static getMixedInModelClassNames ()
 
static isRelationTypeAManyManyVariant ($relationName)
 

Protected Member Functions

 recursiveGetPropagatedAllowPermissions ($role)
 
 getAllDescendentRoles ($role)
 
 afterSave ()
 
 resolvePermitablesToUpdate ()
 
 updatePermitables (ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions)
 
 isPermitableUpdateRequired (ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions)
 
 resolveRelativePermitablesToBeUpdated (ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions)
 
 resolvePermitablesToAttach (ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions)
 
 resolvePermitablesToDetach (ExplicitReadWriteModelPermissions $explicitReadWriteModelPermissions)
 
- Protected Member Functions inherited from Item
 beforeSave ()
 
 afterSave ()
 
 logAuditEventsListForModified ($newModel)
 
- Protected Member Functions inherited from CustomFieldsModel
 unrestrictedGet ($attributeName)
 
 constructDerived ($bean, $setDefaults)
 
- Protected Member Functions inherited from RedBeanModel
 constructDerived ($bean, $setDefaults)
 
 constructIncomplete ($bean)
 
 setNotModified ()
 
 onCreated ()
 
 onLoaded ()
 
 onModified ()
 
 mapAndCacheMetadataAndSetHints ($modelClassName, RedBean_OODBBean $bean)
 
 runDefaultValidators ()
 
 setClassBean ($modelClassName, RedBean_OODBBean $bean)
 
 unrestrictedGet ($attributeName)
 
 unrestrictedSet ($attributeName, $value)
 
 beforeValidate ()
 
 afterValidate ()
 
 beforeSave ()
 
 afterSave ()
 
 linkBeans ()
 
 beforeDelete ()
 
 afterDelete ()
 
 unrestrictedDelete ()
 
 deleteOwnedRelatedModels ($modelClassName)
 
 deleteForeignRelatedModels ($modelClassName)
 
 deleteManyManyRelations ($modelClassName)
 

Additional Inherited Members

- Data Fields inherited from Item
 $originalAttributeValues = array()
 
- Data Fields inherited from RedBeanModel
const MODEL_IDENTIFIER_DELIMITER = '_'
 
- Data Fields inherited from BeanModel
const HAS_ONE_BELONGS_TO = 0
 
const HAS_MANY_BELONGS_TO = 1
 
const HAS_ONE = 2
 
const HAS_MANY = 3
 
const MANY_MANY = 4
 
const OWNED = true
 
const NOT_OWNED = false
 
const CACHE_IDENTIFIER = 'BeanModelMapping'
 
const LINK_TYPE_ASSUMPTIVE = 0
 
const LINK_TYPE_SPECIFIC = 1
 
const LINK_TYPE_POLYMORPHIC = 2
 
- Static Protected Member Functions inherited from Item
static getByNameOrEquivalent ($attributeName, $value)
 
static translatedAttributeLabels ($language)
 
- Static Protected Member Functions inherited from RedBeanModel
static makeCasedLinkName ($relationType, $linkType, $relationLinkName)
 
static getModelIdentifierByClassNameAndBeanId ($modelClassName, $beanId)
 
static assertMetadataIsValid (array $metadata)
 
static getByRelatedClassId ($relatedModelClassName, $id, $modelClassName=null)
 
static getLabel ($language=null)
 
static getPluralLabel ($language=null)
 
static getAttributeLabelByLanguage ($attributeName, $language)
 
static getTranslatedCustomAttributeLabelByLanguage ($attributeName, $languageCode)
 
static resolveModelClassNameForClassesWithoutBeans (&$modelClassName)
 
- Static Protected Member Functions inherited from BeanModel
static translatedAbbreviatedAttributeLabels ($language)
 
static translatedAttributeLabels ($language)
 
static getAttributeNamesToClassNamesForModel ()
 
static getAttributeNamesNotBelongsToOrManyManyForModel ()
 
static getRelationNameToRelationTypeModelClassNameAndOwnsForModel ()
 
static getDerivedRelationNameToTypeModelClassNameAndOppposingRelationForModel ()
 
static forgetBeanModel ($modelClassName)
 
static forgetAllBeanModels ()
 
static resolveCacheAndMapMetadataForAllClassesInHeirarchy ()
 
static resolveCachedMetadataForIntegrity ($cachedData)
 
static resolveLinkTypeAndRelationLinkName ($relationTypeModelClassNameAndOwns, &$linkType, &$relationLinkName)
 
- Protected Attributes inherited from Item
 $isSetting = false
 
 $isAudited = true
 
- Protected Attributes inherited from RedBeanModel
 $modelClassNameToBean = array()
 
 $attributeNameToBeanAndClassName = array()
 
 $relationNameToRelatedModel = array()
 
 $unlinkedRelationNames = array()
 
 $unlinkedOwnedRelatedModelsToRemove = array()
 
 $validators = array()
 
 $attributeNameToErrors = array()
 
 $scenarioName = ''
 
 $modified = false
 
 $deleted = false
 
 $isInIsModified = false
 
 $isInHasErrors = false
 
 $isInGetErrors = false
 
 $isValidating = false
 
 $isSaving = false
 
 $isDeleting = false
 
 $isNewModel = false
 
 $isCopied = false
 
 $isSavableFromRelation = true
 
- Static Protected Attributes inherited from CustomFieldsModel
static $lastClassInBeanHeirarchy = 'CustomFieldsModel'
 
- Static Protected Attributes inherited from RedBeanModel
static $lastClassInBeanHeirarchy = 'RedBeanModel'
 
static $attributeLabelsByLanguage = array()
 
- Static Protected Attributes inherited from BeanModel
static $lastClassInBeanHeirarchy = 'BeanModel'
 

Detailed Description

Definition at line 37 of file SecurableItem.php.

Member Function Documentation

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

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

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.

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

Definition at line 489 of file SecurableItem.php.

static hasReadPermissionsOptimization ( )
static

Override on any models you want to utilize ReadPermissionsOptimization

Definition at line 527 of file SecurableItem.php.

afterSave ( )
protected

Handle Permitable Attachment/Detachment after model has been saved.

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:
Generated on Sun May 31 2020 07:11:00