Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test 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 6009 to 6045

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$collection_allow_empty_share;

    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 || $collection_allow_empty_share)
        && (
$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 17th November 2024 15:35 Europe/London time based on the source file dated 13th November 2024 15:50 Europe/London time.