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

collection_max_access()

Description

Returns the maximum access (the most permissive) that the current user has to the resources in $collection.

Parameters

ColumnTypeDefaultDescription
$collection integer

Return

integer

Location

include/collections_functions.php lines 3665 to 3680

Definition

 
function collection_max_access($collection
    {
    
$maxaccess=2;
    
$result=do_search("!collection" $collection);
    if (!
is_array($result))
        {
        
$result = array();
        }
    for (
$n=0;$n<count($result);$n++)
        {
        
# Load access level
        
$access=get_resource_access($result[$n]);
        if (
$access<$maxaccess) {$maxaccess=$access;}
        }
    return 
$maxaccess;
    }

This article was last updated 17th November 2024 15:35 Europe/London time based on the source file dated 13th November 2024 15:50 Europe/London time.