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

allow_upload_to_collection()

Description

Check access control if user is allowed to upload to a collection.

Parameters

ColumnTypeDefaultDescription
$c array Collection data structure

Return

boolean

Location

include/collections_functions.php lines 5015 to 5046

Definition

 
function allow_upload_to_collection(array $c)
    {
    if(empty(
$c))
        {
        return 
false;
        }

    if(
        
$c["type"] == COLLECTION_TYPE_SELECTION
        
// Featured Collection Categories can't contain resources, only other featured collections (categories or normal)
        
|| ($c["type"] == COLLECTION_TYPE_FEATURED && is_featured_collection_category_by_children($c["ref"]))
    )
        {
        return 
false;
        }

    global 
$userref$k$internal_share_access;

    
$internal_share_access = (!is_null($internal_share_access) && is_bool($internal_share_access) ? $internal_share_access internal_share_access());

    if(
        (
$k == "" || $internal_share_access)
        && (
$c["savedsearch"] == "" || $c["savedsearch"] == 0)
        && (
$userref == $c["user"] || $c["allow_changes"] == || checkperm("h"))
        && (
checkperm("c") || checkperm("d"))
    )
        {
        return 
true;
        }

    return 
false;
    }

This article was last updated 18th January 2021 10:35 Europe/London time based on the source file dated 13th January 2021 13:50 Europe/London time.