Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

allow_collection_share()

Description

Check if user is allowed to share collection

Parameters

ColumnTypeDefaultDescription
$c array Collection data

Return

boolean Return TRUE if user is allowed to share the collection, FALSE otherwise

Location

include/collections_functions.php lines 5071 to 5104

Definition

 
function allow_collection_share(array $c)
    {
    global 
$allow_share$manage_collections_share_link$k$internal_share_access,
    
$restricted_share$system_read_only$system_read_only;

    if(!isset(
$GLOBALS["count_result"]))
        {
        
$collection_resources get_collection_resources($c["ref"]);
        
$collection_resources = (is_array($collection_resources) ? count($collection_resources) : 0);
        }
    else
        {
        
$collection_resources $GLOBALS["count_result"];
        }
    
$internal_share_access = (!is_null($internal_share_access) && is_bool($internal_share_access) ? $internal_share_access internal_share_access());

    if(
        
$allow_share
        
&& !$system_read_only
        
&& $manage_collections_share_link
        
&& $collection_resources 0
        
&& ($k == "" || $internal_share_access)
        && !
checkperm("b")
        && (
checkperm("v")
            || 
checkperm ("g"
            || 
collection_min_access($c["ref"]) <= RESOURCE_ACCESS_RESTRICTED
            
|| $restricted_share)
    )
        {
        return 
true;
        }

    return 
false;
    }

This article was last updated 21st April 2021 18:05 Europe/London time based on the source file dated 19th April 2021 16:50 Europe/London time.