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

ajax_permission_denied()

Description

@package ResourceSpace
@subpackage AJAX

The functions available in this file will help developers provide a consistent response to AJAX requests.

All functions (with the exception of ajax_permission_denied) will follow the JSEnd specification (@see https://github.com/omniti-labs/jsend)




Returns a standard AJAX response for unauthorised access

The function will return a 401 HTTP status code.

@deprecated

Parameters

This function accepts no parameters.

Return

void

Location

include/ajax_functions.php lines 22 to 32

Definition

 
function ajax_permission_denied()
{
    
$return['error'] = array(
        
'status' => 401,
        
'title'  => $GLOBALS["lang"]["unauthorized"],
        
'detail' => $GLOBALS["lang"]['error-permissiondenied']);

    
http_response_code(401);
    echo 
json_encode($return);
    exit();
}

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