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_user()

Description

Retrieves the custom access level for a specific user on a given resource.

This function checks the `resource_custom_access` table to see if the user has any custom access
permissions for the specified resource. It returns the access level if found and still valid;
otherwise, it returns false.

Parameters

ColumnTypeDefaultDescription
$resource int The resource ID to check access for.
$user int The user ID to check for custom access.

Return

mixed The access level if found; false otherwise.

Location

include/resource_functions.php lines 5606 to 5609

Definition

 
function get_custom_access_user($resource,$user)
    {
    return 
ps_value("select access value from resource_custom_access where resource=? and user=? and (user_expires is null or user_expires>now())",array("i",$resource,"i",$user),false);
    }

This article was last updated 4th December 2024 09:05 Europe/London time based on the source file dated 28th November 2024 12:10 Europe/London time.