Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource 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 3638 to 3653

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 19th March 2024 10:35 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.