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

can_create_collections()

Description

Determines whether the current user has permission to create collections.

This function checks for specific conditions that would prevent the user from creating collections.
It returns `false` if any of these conditions are met:
- The user has the "b" permission, which restricts collection creation.
- The user is anonymous and does not have a session collection.

Parameters

This function accepts no parameters.

Return

bool Returns `true` if the user can create collections; otherwise, `false`.

Location

include/collections_functions.php lines 6514 to 6521

Definition

 
function can_create_collections()
{
    global 
$anonymous_user_session_collection;
    return  !( 
// Return FALSE if any of these conditions are true
        
checkperm("b")
         || (
is_anonymous_user() && !$anonymous_user_session_collection// User is an anonymous user
        
);
}

This article was last updated 22nd January 2025 15:35 Europe/London time based on the source file dated 21st January 2025 15:20 Europe/London time.