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

collection_can_download()

Description

Check whether an entire colleciton is eligible to be downloaded

Parameters

ColumnTypeDefaultDescription
$ref
$size

Location

include/collections_functions.php lines 6562 to 6579

Definition

 
function collection_can_download($ref$size
{
    
$min_access collection_min_access($ref);

    if (
$min_access == 0) {
        return 
true;
    }

    
$resources  do_search("!collection{$ref}"'''relevance'0, -1'desc'false''false''''falsefalsetrue);
    
$resourse_types array_column($resources'resource_type');
    foreach (
$resourse_types as $type) {
        if (
checkperm('X' $type "_" $size)) {
            return 
false;
        }
    }

    return 
true;
}

This article was last updated 10th March 2025 20:35 Europe/London time based on the source file dated 10th March 2025 14:25 Europe/London time.