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

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") && array_key_exists("expires"$details) && empty($details["expires"]));
    }

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