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

Static Public Member Functions

static buildTables ()
 
static recreateTable ($modelSubscriptionTableName)
 
static recreateAccountBuildTable ()
 
static deleteUserItemsFromAllReadSubscriptionTables ($userId)
 
static updateAccountReadSubscriptionTableBasedOnBuildTable ($accountId)
 
static getSubscriptionTableName ($modelClassName)
 
static getAccountSubscriptionTempBuildTableName ()
 
static updateAllReadSubscriptionTables (MessageLogger $messageLogger, $modelClassNames=null, $arrayOfModelIdsToUpdate=array())
 
static updateReadSubscriptionTableFromBuildTable (MessageLogger $messageLogger, $modelClassName=null)
 
static rebuildAllReadPermissionSubscriptionData ()
 
static groupParentHasChanged ()
 
static groupHasBeenDeleted ()
 
static securableItemGivenPermissionsForGroup (SecurableItem $securableItem)
 
static securableItemLostPermissionsForGroup (SecurableItem $securableItem)
 
static securableItemGivenPermissionsForUser (SecurableItem $securableItem)
 
static securableItemLostPermissionsForUser (SecurableItem $securableItem)
 
static userCreated ()
 
static userAddedToGroup ()
 
static userRemovedFromGroup ()
 
static userAddedToRole ()
 
static userBeingRemovedFromRole ()
 
static roleParentSet ()
 
static roleParentBeingRemoved ()
 
static roleHasBeenDeleted ()
 
static modulePermissionsHasBeenChanged ($permitable)
 
static updateReadSubscriptionTableByModelClassNameAndUser ($modelClassName, User $user, $updateStartTimestamp, $onlyOwnedModels=false, MessageLogger $messageLogger, $arrayOfModelIdsToUpdate=array())
 
static addModelToReadSubscriptionTableByModelIdAndModelClassNameAndUser ($modelId, $modelClassName, User $user)
 
static deleteModelFromReadSubscriptionTableByModelIdAndModelClassNameAndUser ($modelId, $modelClassName, User $user)
 
static changeOwnerOfModelInReadSubscriptionTableByModelIdAndModelClassNameAndUser ($modelId, $modelClassName, User $user)
 
static getAddedOrDeletedModelsFromReadSubscriptionTable ($serviceName, $modelClassName, $lastUpdateTimestamp, $type, $user, $checkIfModelCreationApiSyncUtilIsNull=true)
 
static getAddedModelNamesAndIdsFromReadSubscriptionTable ($serviceName, $modelClassName, $lastUpdateTimestamp, $user)
 
static getReadSubscriptionUpdateDetails ()
 
static setReadSubscriptionUpdateDetails ($readSubscriptionUpdateDetails)
 
static getLastReadPermissionUpdateTimestamp ()
 
static setTimeReadPermissionUpdateTimestamp ($lastReadPermissionUpdateTimestamp)
 
static setReadPermissionUpdateStatus ($status)
 
static getReadPermissionUpdateStatus ()
 
static isReadPermissionSubscriptionUpdateCompleted ()
 

Data Fields

const TYPE_ADD = 1
 
const TYPE_DELETE = 2
 
const STATUS_STARTED = 1
 
const STATUS_COMPLETED = 2
 

Static Protected Member Functions

static getReadSubscriptionTableSchemaByName ($tableName)
 
static getReadSubscriptionTableSchemaForAccountTempTable ()
 
static getAccountIdsArrayFromBuildTable ()
 
static addAccountIdToBuildTable ($accountId)
 
static deleteAccountIdFromBuildTable ($accountId)
 
static getModelTableName ($modelClassName)
 
static runJobForAccountsWhenRoleOrGroupChanged ()
 
static runJobForAccountsWhenAccountPermissionsChanged ()
 
static runJobForAccountsWhenPermitableChanged ()
 
static deleteOnlyModelToReadSubscriptionTableByModelIdAndModelClassName ($modelId, $modelClassName)
 

Detailed Description

Definition at line 37 of file ReadPermissionsSubscriptionUtil.php.

Member Function Documentation

static buildTables ( )
static

Rebuild read permission subscription table

Definition at line 48 of file ReadPermissionsSubscriptionUtil.php.

static recreateTable (   $modelSubscriptionTableName)
static

Public for testing only. Need to manually create test model tables that would not be picked up normally.

Parameters
$modelSubscriptionTableName

Definition at line 64 of file ReadPermissionsSubscriptionUtil.php.

static getAccountIdsArrayFromBuildTable ( )
staticprotected

Get array odf all account ids from account temp build table

Returns
array

Definition at line 158 of file ReadPermissionsSubscriptionUtil.php.

static getAccountSubscriptionTempBuildTableName ( )
static

Get able name for account temp build table

Returns
string

Definition at line 246 of file ReadPermissionsSubscriptionUtil.php.

static updateAllReadSubscriptionTables ( MessageLogger  $messageLogger,
  $modelClassNames = null,
  $arrayOfModelIdsToUpdate = array() 
)
static

Update read subscription table for all users and models

Parameters
MessageLogger$messageLogger
null  |  array$modelClassNames
array$arrayOfModelIdsToUpdatepermission subscription table just for account ids that exist in account temp build table
Returns
bool

Definition at line 259 of file ReadPermissionsSubscriptionUtil.php.

static updateReadSubscriptionTableFromBuildTable ( MessageLogger  $messageLogger,
  $modelClassName = null 
)
static
Parameters
MessageLogger$messageLogger
null$modelClassName

Definition at line 321 of file ReadPermissionsSubscriptionUtil.php.

static rebuildAllReadPermissionSubscriptionData ( )
static

Rebuild All Read Permission Subscription Data

Definition at line 341 of file ReadPermissionsSubscriptionUtil.php.

static groupParentHasChanged ( )
static

Update all account read permissions items, because group parent is changed

Definition at line 349 of file ReadPermissionsSubscriptionUtil.php.

static groupHasBeenDeleted ( )
static

Update all account read permissions items, because group is deleted

Definition at line 357 of file ReadPermissionsSubscriptionUtil.php.

static securableItemGivenPermissionsForGroup ( SecurableItem  $securableItem)
static

Update all account read permissions items when permissions for item is added to group

Definition at line 365 of file ReadPermissionsSubscriptionUtil.php.

static securableItemLostPermissionsForGroup ( SecurableItem  $securableItem)
static

Update all account read permissions items when permissions for item is removed from group

Definition at line 378 of file ReadPermissionsSubscriptionUtil.php.

static securableItemGivenPermissionsForUser ( SecurableItem  $securableItem)
static

Update all account read permissions items when permissions for item is added to user

Definition at line 391 of file ReadPermissionsSubscriptionUtil.php.

static securableItemLostPermissionsForUser ( SecurableItem  $securableItem)
static

Update all account read permissions items when permissions for item is removed from user

Definition at line 404 of file ReadPermissionsSubscriptionUtil.php.

static userCreated ( )
static

Update all read permissions, when new user is created

Definition at line 417 of file ReadPermissionsSubscriptionUtil.php.

static userAddedToGroup ( )
static

Update all account read permissions items when user is added to group

Definition at line 426 of file ReadPermissionsSubscriptionUtil.php.

static userRemovedFromGroup ( )
static

Update all account read permissions items when user is removed from group

Definition at line 435 of file ReadPermissionsSubscriptionUtil.php.

static userAddedToRole ( )
static

Update all account read permissions items when user is added to role

Definition at line 444 of file ReadPermissionsSubscriptionUtil.php.

static userBeingRemovedFromRole ( )
static

Update all account read permissions items when user is removed from role

Definition at line 453 of file ReadPermissionsSubscriptionUtil.php.

static roleParentSet ( )
static

Update all account read permissions tables, because role parent is set

Definition at line 462 of file ReadPermissionsSubscriptionUtil.php.

static roleParentBeingRemoved ( )
static

Update all account read permissions tables, because role parent is removed

Definition at line 470 of file ReadPermissionsSubscriptionUtil.php.

static roleHasBeenDeleted ( )
static

Update all account read permissions tables, because role is deleted

Definition at line 479 of file ReadPermissionsSubscriptionUtil.php.

static modulePermissionsHasBeenChanged (   $permitable)
static

Update all account read permissions tables when group access to module changed

Definition at line 487 of file ReadPermissionsSubscriptionUtil.php.

static updateReadSubscriptionTableByModelClassNameAndUser (   $modelClassName,
User  $user,
  $updateStartTimestamp,
  $onlyOwnedModels = false,
MessageLogger  $messageLogger,
  $arrayOfModelIdsToUpdate = array() 
)
static

Update models in read subscription table based on modelId and userId(userId is used implicitly in getSubsetIds)

Parameters
string$modelClassName
User$user
bool$onlyOwnedModels
int$updateStartTimestamp
MessageLogger$messageLogger
array$arrayOfModelIdsToUpdatepermission subscription table just for account ids that exist in account temp build table

Definition at line 520 of file ReadPermissionsSubscriptionUtil.php.

static addModelToReadSubscriptionTableByModelIdAndModelClassNameAndUser (   $modelId,
  $modelClassName,
User  $user 
)
static

Add new model to read permission subscription table

Parameters
int$modelId
string$modelClassName
User$user

Definition at line 651 of file ReadPermissionsSubscriptionUtil.php.

static deleteModelFromReadSubscriptionTableByModelIdAndModelClassNameAndUser (   $modelId,
  $modelClassName,
User  $user 
)
static

Delete model read permission subscription table by model id, class name and user

Parameters
int$modelId
string$modelClassName
User$user

Definition at line 687 of file ReadPermissionsSubscriptionUtil.php.

static deleteOnlyModelToReadSubscriptionTableByModelIdAndModelClassName (   $modelId,
  $modelClassName 
)
staticprotected
Parameters
int$modelId
string$modelClassName

Definition at line 721 of file ReadPermissionsSubscriptionUtil.php.

static changeOwnerOfModelInReadSubscriptionTableByModelIdAndModelClassNameAndUser (   $modelId,
  $modelClassName,
User  $user 
)
static

Call this function when changing model owner This function first mark model as deleted for all users where type was added, and change timestamp, then it add new record for new owner.

Parameters
int$modelId
string$modelClassName
User$user

Definition at line 746 of file ReadPermissionsSubscriptionUtil.php.

static getAddedOrDeletedModelsFromReadSubscriptionTable (   $serviceName,
  $modelClassName,
  $lastUpdateTimestamp,
  $type,
  $user,
  $checkIfModelCreationApiSyncUtilIsNull = true 
)
static

Get all added or deleted models from read permission subscription table

Parameters
$serviceName
$modelClassName
$lastUpdateTimestamp
$type
$user
$checkIfModelCreationApiSyncUtilIsNull
Returns
array

Definition at line 764 of file ReadPermissionsSubscriptionUtil.php.

static getAddedModelNamesAndIdsFromReadSubscriptionTable (   $serviceName,
  $modelClassName,
  $lastUpdateTimestamp,
  $user 
)
static

Get all added model names and ids from read permission subscription table

Parameters
$serviceName
$modelClassName
$lastUpdateTimestamp
$user
Returns
array

Definition at line 815 of file ReadPermissionsSubscriptionUtil.php.

static getReadSubscriptionUpdateDetails ( )
static

Get details about read subscription update details from configuration(global metadata)

Returns
array

Definition at line 851 of file ReadPermissionsSubscriptionUtil.php.

static setReadSubscriptionUpdateDetails (   $readSubscriptionUpdateDetails)
static

Set read subscription update details from configuration(global metadata)

Parameters
array$readSubscriptionUpdateDetails

Definition at line 862 of file ReadPermissionsSubscriptionUtil.php.

static getLastReadPermissionUpdateTimestamp ( )
static

Get last read permission update timestamp in read subscription update details(stored in configuration)

Returns
int

Definition at line 872 of file ReadPermissionsSubscriptionUtil.php.

static setTimeReadPermissionUpdateTimestamp (   $lastReadPermissionUpdateTimestamp)
static

Set last read permission update timestamp in read subscription update details(stored in configuration)

Parameters
int$lastReadPermissionUpdateTimestamp

Definition at line 889 of file ReadPermissionsSubscriptionUtil.php.

static setReadPermissionUpdateStatus (   $status)
static

Set status of ReadPermissionSubscription update(stored in configuration)

Parameters
int$status

Definition at line 900 of file ReadPermissionsSubscriptionUtil.php.

static getReadPermissionUpdateStatus ( )
static

Get status of ReadPermissionSubscription update(stored in configuration)

Returns
int

Definition at line 911 of file ReadPermissionsSubscriptionUtil.php.

static isReadPermissionSubscriptionUpdateCompleted ( )
static

Check if ReadPermissionSubscription

Returns
bool

Definition at line 928 of file ReadPermissionsSubscriptionUtil.php.


The documentation for this class was generated from the following file:
Generated on Mon Jan 27 2020 07:10:47