Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test 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 4371 to 4389

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 4th December 2024 08:35 Europe/London time based on the source file dated 28th November 2024 12:10 Europe/London time.