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

can_edit_upload_share()

Description

Check if user can edit an existing upload share

Parameters

ColumnTypeDefaultDescription
$collection int Collection ID of share
$uploadkey string External upload key

Return

bool

Location

include/collections_functions.php lines 5366 to 5379

Definition

 
function can_edit_upload_share($collection,$uploadkey)
    {
    global 
$userref;
    if(
checkperm('a'))
        {
        return 
true;
        }
    
$share_details get_external_shares(array("share_collection"=>$collection,"share_type"=>1"access_key"=>$uploadkey));
    
$details = isset($share_details[0]) ? $share_details[0] : array();
    return ((isset(
$details["user"]) && $details["user"] == $userref)
        || 
      (
checkperm("ex") && isset($details["expires"]) && empty($details["expires"]))
    );
    }

This article was last updated 28th February 2021 15:05 Europe/London time based on the source file dated 26th February 2021 11:40 Europe/London time.