Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video 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 2734 to 2750

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++)
        {
        
$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 1st December 2020 07:35 Europe/London time based on the source file dated 30th November 2020 16:50 Europe/London time.