Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

get_custom_access()

Description

Lookup custom access value for a resource


Int representing custom access level if set; 0 - open, 1 - restricted, 2 - confidential.

Parameters

ColumnTypeDefaultDescription
$resource int Resource ID.
$usergroup int User group ID.
$return_default bool true Return default custom access value RESOURCE_ACCESS_CONFIDENTIAL

Return

mixed False if custom access is disabled or there is no custom access value set for this resource.

Location

include/resource_functions.php lines 4339 to 4357

Definition

 
function get_custom_access($resource$usergroup$return_default true)
    {
    global 
$custom_access;

    if (
$custom_access == false) {return false;}

    
$result ps_value("select access value from resource_custom_access where resource = ? and usergroup = ?", array("i"$resource"i"$usergroup), '');

    if (
$result === '' && $return_default)
        {
        return 
RESOURCE_ACCESS_CONFIDENTIAL;
        }
    elseif (
$result === '')
        {
        return 
false;
        }

    return 
$result;
    }

This article was last updated 21st May 2024 12:05 Europe/London time based on the source file dated 20th May 2024 14:55 Europe/London time.