Policy
class Policy
Properties
static | $parity_ints |
Methods
Helper callback for the create_policy_clusters Method, sorting the found clusters based on the number of rows (policies) they contain.
Calculates all policy clusters as well as user diffs, thus updating the whole system right management WARNING: May take a few minutes and can cause performance lacks!
No description
Returns the instance ids of all ancestors for a given instance id, including the passed one
Retrieves a dummy policy value for a given hook
Generate the policy key for a given policy setting
Generate the policy key for a given policy setting
Return users in clusters that have the same rights settings A document index may be passed to group the users to clusters that have the same rights for that particular document
Returns users grouped into clusters that have the same rights An array of instance ids can be passed in order to group users that have the same rights within the scope of these instances.
No description
Invalidate User Policy Diff for passed User IDs All Invalidated User Policy Diffs will be Reloaded the next Time a New / Dirty Session is loaded
Generates a filtered policy array using a policy centroid (which can also be a user_diff), an optional changes array and an optional set of prefixes the found policies should be filtered for. Returns an assoc array that holds the proper parity integer for each policy key found. This may include unset properties as them being unset is only saved in the changes column of the user_policy_diff table until the next user group calc run.
Sets all static policies and page access rights for all provided users and groups based on the access level.
Returns all users that have a certain policy parity.
Details
at line 991
mixed
_cb_sort_policy_clusters_by_row_count_desc(mixed $a, mixed $b)
Helper callback for the create_policy_clusters Method, sorting the found clusters based on the number of rows (policies) they contain.
at line 705
batch_calculate_policy_clusters_and_user_diffs()
Calculates all policy clusters as well as user diffs, thus updating the whole system right management WARNING: May take a few minutes and can cause performance lacks!
at line 616
int[]
find_users_with_policy(string $instance_id, string $policy_name, string $value = null, int|string $group_security_id = 0)
No description
at line 518
string[]
get_all_parent_contexts(string $current)
Returns the instance ids of all ancestors for a given instance id, including the passed one
at line 1261
int
get_hook_policy_value(string $instance_id, string $hook_name)
Retrieves a dummy policy value for a given hook
at line 44
string
get_policy_key(int $policy_id, bool|int $global_group_security_id = false, mixed $value = false, bool $return_prefix = false)
Generate the policy key for a given policy setting
at line 28
string
get_policy_key_by_names(string $instance_id, string $policy_name, bool|int $global_group_security_id = false, mixed $value = false, bool $return_prefix = false)
Generate the policy key for a given policy setting
at line 474
array
get_user_clusters(bool|int|DocumentIndex $document_index = false, bool $only_active_users = true, $access_level = XF_SEC_LEVEL_ADMIN)
Return users in clusters that have the same rights settings A document index may be passed to group the users to clusters that have the same rights for that particular document
at line 210
array
get_user_clusters_for_instance_ids(string[] $instance_ids = array(), $global_group_security_ids = array(), bool $only_active_users = true, $access_level = XF_SEC_LEVEL_ADMIN)
Returns users grouped into clusters that have the same rights An array of instance ids can be passed in order to group users that have the same rights within the scope of these instances.
It is recommended that you use get_user_clusters instead, based on the document index rather than the instance ids to avoid missing references.
at line 1104
invalidate_policy_cluster()
No description
at line 1084
invalidate_user_policy_diff($user_ids)
Invalidate User Policy Diff for passed User IDs All Invalidated User Policy Diffs will be Reloaded the next Time a New / Dirty Session is loaded
at line 155
array
parse_policies(string $centroid, string $changes = '', string[] $policy_prefixes = array())
Generates a filtered policy array using a policy centroid (which can also be a user_diff), an optional changes array and an optional set of prefixes the found policies should be filtered for. Returns an assoc array that holds the proper parity integer for each policy key found. This may include unset properties as them being unset is only saved in the changes column of the user_policy_diff table until the next user group calc run.
at line 1169
set_instance_policies_to_level(string $instance_id, array $group_per_level = array(), array $user_per_level = array(), int $global_group_security_id = 0, bool $apply_to_dependencies = true)
Sets all static policies and page access rights for all provided users and groups based on the access level.
It takes the instance definition (e.g. the instance id and the gsc for wich the rights are to be set), as well as assoc user and group arrays that list all users and groups that have a specific security level. These users and groups will be granted the access to all policies and pages of that or a lower security level.
at line 543
int[]
users_that_have_policy(mixed $instance_id, mixed $policy_name, mixed $value = '*', mixed $group_security_id = '0', mixed $parity = 'allow', $return_only_active_users = true)
Returns all users that have a certain policy parity.
This function has not yet been tested! It is is experimental and was created as to test the new cluster mechanism. It is, however, likely that a later iteration requires this funciton again.