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 from config. $default_customaccess.

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 4292 to 4310

Definition

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

    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 
$default_customaccess;
        }
    elseif (
$result === '')
        {
        return 
false;
        }

    return 
$result;
    }

This article was last updated 19th March 2024 10:05 Europe/London time based on the source file dated 11th March 2024 14:25 Europe/London time.