Collections functions
General functions
Node functions
Render functions
Theme permission functions
User 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 5963 to 5999

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 (!isset(
$c['type'])){$c get_collection($c['ref']);}
    
    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)
        && !
in_array($c['type'],[COLLECTION_TYPE_REQUEST])
    )
        {
        return 
true;
        }

    return 
false;
    }

This article was last updated 19th March 2024 11:05 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.