Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

collection_max_access()

Parameters

ColumnTypeDefaultDescription
$collection

Location

include/collections_functions.php lines 2187 to 2200

Definition

 
function collection_max_access($collection)    
    {
    
# Returns the maximum access (the most permissive) that the current user has to the resources in $collection.
    
$maxaccess=2;
    
$result=do_search("!collection" $collection);
    for (
$n=0;$n<count($result);$n++)
        {
        
$ref=$result[$n]["ref"];
        
# Load access level
        
$access=get_resource_access($result[$n]);
        if (
$access<$maxaccess) {$maxaccess=$access;}
        }
    return 
$maxaccess;
    }

This article was last updated 7th July 2020 09:05 Europe/London time based on the source file dated 3rd July 2020 14:33 Europe/London time.