/sources/permissions.php

Description
Functions
access_denied (line 92)

Show a helpful access-denied page. Has a login ability if it senses that logging in could curtail the error.

void access_denied (ID_TEXT $class, [string $param = ''], [boolean $force_login = false])
  • ID_TEXT $class: The class of error (e.g. SPECIFIC_PERMISSION)
  • string $param: The parameteter given to the error message
  • boolean $force_login: Force the user to login (even if perhaps they are logged in already)
check_delete_permission (line 655)

Check if a member's has permission to delete a specific resource. If it doesn't, an error message is outputted.

void check_delete_permission (string $range, ?MEMBER $resource_owner, [?array $cats = NULL], [?ID_TEXT $page = NULL])
  • string $range: The range of permission we are checking to see if they have; these ranges are like trust levels
  • ?MEMBER $resource_owner: The member that owns this resource (NULL: no-one)
  • ?array $cats: A list of cat details to require access to (c-type-1,c-id-1,c-type-2,c-d-2,...) (NULL: N/A)
  • ?ID_TEXT $page: The ID code for the page being checked (NULL: current page)
check_edit_permission (line 619)

Check to see if a member's has permission to edit an item. If it doesn't, an error message is outputted.

void check_edit_permission (string $range, ?MEMBER $resource_owner, [?array $cats = NULL], [?ID_TEXT $page = NULL])
  • string $range: The range of permission we are checking to see if they have; these ranges are like trust levels
  • ?MEMBER $resource_owner: The member that owns this resource (NULL: no-one)
  • ?array $cats: A list of cat details to require access to (c-type-1,c-id-1,c-type-2,c-d-2,...) (NULL: N/A)
  • ?ID_TEXT $page: The ID code for the page being checked (NULL: current page)
check_some_edit_permission (line 599)

Check to see if a member's has permission to edit an item. If it doesn't, an error message is outputted.

void check_some_edit_permission (string $range, [?array $cats = NULL])
  • string $range: The range of permission we are checking to see if they have; these ranges are like trust levels
  • ?array $cats: A list of cat details to require access to (c-type-1,c-id-1,c-type-2,c-d-2,...) (NULL: N/A)
check_specific_permission (line 422)

Require presence of a permission for the current member; otherwise exit.

void check_specific_permission (ID_TEXT $permission, [?array $cats = NULL], [?MEMBER $member_id = NULL])
  • ID_TEXT $permission: The permission to require
  • ?array $cats: A list of cat details to require access to (c-type-1,c-id-1,c-type-2,c-d-2,...) (NULL: N/A)
  • ?MEMBER $member_id: Member to check for (NULL: current user)
check_submit_permission (line 549)

Check to see if a member's has permission to submit an item. If it doesn't, an error message is outputted.

void check_submit_permission (string $range, [?array $cats = NULL], [?ID_TEXT $page = NULL])
  • string $range: The range of permission we are checking to see if they have; these ranges are like trust levels
  • ?array $cats: A list of cat details to require access to (c-type-1,c-id-1,c-type-2,c-d-2,...) (NULL: N/A)
  • ?ID_TEXT $page: The ID code for the page being checked (NULL: current page)
enforce_personal_access (line 402)

Only allow members here that are either the give member, admins, or have a specific-permission. All other members come up to an error message wall.

void enforce_personal_access (MEMBER $member_id, [?ID_TEXT $permission = NULL], [?ID_TEXT $permission2 = NULL])
  • MEMBER $member_id: The member who typically (i.e. when it's not an administrative override) we want the current member to be.
  • ?ID_TEXT $permission: The override permission the current member must have (NULL: no general override).
  • ?ID_TEXT $permission2: An alternative permission to the 'assume_any_member' permission (NULL: no override).
handle_permission_check_logging (line 61)

Log permission checks to the permission_checks.log file, if it exists.

void handle_permission_check_logging (MEMBER $member, ID_TEXT $op, array $params, boolean $result)
  • MEMBER $member: The user checking against
  • ID_TEXT $op: The function that was called to check a permission
  • array $params: Parameters to this permission-checking function
  • boolean $result: Whether the permission was held
has_actual_page_access (line 151)

Find if a member's has access to a specified page. Zone permissions are taken into account for wherever the page is found at. Also support for category access and specific permissions. No support for entry-point checks, which are only carried out as an extension of page permissions when actually at a page.

  • return: Whether the member has zone and page access
boolean has_actual_page_access ([?MEMBER $member = NULL], [?ID_TEXT $page = NULL], [?ID_TEXT $zone = NULL], [?array $cats = NULL], [?mixed $sp = NULL])
  • ?MEMBER $member: The member being checked whether to have the access (NULL: current member)
  • ?ID_TEXT $page: The ID code for the page being checked (NULL: current page)
  • ?ID_TEXT $zone: The ID code for the zone being checked (NULL: search)
  • ?array $cats: A list of cat details to require access to (c-type-1,c-id-1,c-type-2,c-d-2,...) (NULL: N/A)
  • ?mixed $sp: Either the ID code of a specific-permission, an array of alternatives that are acceptable (NULL: none required)
has_category_access (line 335)

Find if a member's has access to a specified category

  • return: Whether the member has category access
boolean has_category_access (MEMBER $member, ID_TEXT $module, ID_TEXT $category)
  • MEMBER $member: The member being checked whether to have the access
  • ID_TEXT $module: The ID code for the module being checked for category access
  • ID_TEXT $category: The ID code for the category being checked for access (often, a number cast to a string)
has_delete_permission (line 674)

Check to see if a member's has permission to delete a specific resource

  • return: Whether the member may delete the resource
boolean has_delete_permission (string $range, MEMBER $member, ?MEMBER $resource_owner, ?ID_TEXT $page, [?mixed $cats = NULL])
  • string $range: The range of permission we are checking to see if they have; these ranges are like trust levels
  • MEMBER $member: The member being checked for access
  • ?MEMBER $resource_owner: The member that owns this resource (NULL: no-one)
  • ?ID_TEXT $page: The ID code for the page being checked (NULL: current page)
  • ?mixed $cats: Either the ID code of a specific-permission, an array of alternatives that are acceptable (NULL: none required)
has_edit_permission (line 638)

Find if a member's has permission to edit

  • return: Whether the member may edit the resource
boolean has_edit_permission (string $range, MEMBER $member, ?MEMBER $resource_owner, ?ID_TEXT $page, [?mixed $cats = NULL])
  • string $range: The range of permission we are checking to see if they have; these ranges are like trust levels
  • MEMBER $member: The member being checked for access
  • ?MEMBER $resource_owner: The member that owns this resource (NULL: no-one)
  • ?ID_TEXT $page: The ID code for the page being checked (NULL: current page)
  • ?mixed $cats: Either the ID code of a specific-permission, an array of alternatives that are acceptable (NULL: none required)
has_page_access (line 215)

Find if a member's has access to a specified page, in a specific zone. Note that page access does not imply zone access; you have access a page, but not the zone, so still couldn't see it.

  • return: Whether the member has page access
boolean has_page_access (MEMBER $member, ID_TEXT $page, ID_TEXT $zone, [boolean $at_now = false])
  • MEMBER $member: The member being checked whether to have the access
  • ID_TEXT $page: The ID code for the page being checked
  • ID_TEXT $zone: The ID code for the zone being checked
  • boolean $at_now: Whether we want to check we have access to the CURRENT page, using any match tag permissions
has_some_cat_specific_permission (line 437)

Find if a member has a specified permission in any category

  • return: Whether the member has the permission
boolean has_some_cat_specific_permission (MEMBER $member, ID_TEXT $permission, ?ID_TEXT $page, ID_TEXT $permission_module)
  • MEMBER $member: The member being checked whether to have the permission
  • ID_TEXT $permission: The ID code for the permission being checked for
  • ?ID_TEXT $page: The ID code for the page being checked (NULL: current page)
  • ID_TEXT $permission_module: The ID code for the permission module being checked for
has_specific_permission (line 463)

Find if a member has a specified permission

  • return: Whether the member has the permission
boolean has_specific_permission (MEMBER $member, ID_TEXT $permission, [?ID_TEXT $page = NULL], [?array $cats = NULL])
  • MEMBER $member: The member being checked whether to have the permission
  • ID_TEXT $permission: The ID code for the permission being checked for
  • ?ID_TEXT $page: The ID code for the page being checked (NULL: current page)
  • ?array $cats: A list of cat details to require access to (c-type-1,c-id-1,c-type-2,c-d-2,...) (NULL: N/A)
has_submit_permission (line 568)

Find if a member's has permission to submit

  • return: Whether the member can submit in this range
boolean has_submit_permission (string $range, MEMBER $member, IP $ip, ?ID_TEXT $page, [?mixed $cats = NULL])
  • string $range: The range of permission we are checking to see if they have; these ranges are like trust levels
  • MEMBER $member: The member being checked whether to have the access
  • IP $ip: The member's IP address
  • ?ID_TEXT $page: The ID code for the page being checked (NULL: current page)
  • ?mixed $cats: Either the ID code of a specific-permission, an array of alternatives that are acceptable (NULL: none required)
has_zone_access (line 105)

Find if a member's has access to a specified zone

  • return: Whether the member has zone access
boolean has_zone_access (MEMBER $member, ID_TEXT $zone)
  • MEMBER $member: The member being checked whether to have the access
  • ID_TEXT $zone: The ID code for the zone being checked
init__permissions (line 24)

Standard code module initialisation function.

void init__permissions ()
load_up_all_module_category_permissions (line 282)

For efficiency reasons, load up loads of category permissions.

void load_up_all_module_category_permissions (MEMBER $member, [?ID_TEXT $module = NULL])
  • MEMBER $member: The member being checked whether to have the access
  • ?ID_TEXT $module: The ID code for the module being checked for category access (NULL: all categories)
load_up_all_self_page_permissions (line 197)

For efficiency reasons, load up loads of page permissions.

void load_up_all_self_page_permissions (MEMBER $member)
  • MEMBER $member: The member being checked whether to have the access
_get_where_clause_groups (line 377)

Get the SQL WHERE clause to select for any the given member is in (gets combined with some condition, to check against every).

  • return: The SQL query fragment (NULL: admin, so permission regardless)
?string _get_where_clause_groups (MEMBER $member)
  • MEMBER $member: The member who's usergroups will be OR'd

Documentation generated on Sun, 02 Jan 2011 23:20:57 +0000 by phpDocumentor 1.4.3