Property | Type | Description | |
---|---|---|---|
$authenticator | RESTfulAPI_Authenticator | Current Authenticator instance | |
$authority | RESTfulAPI_PermissionManager | Current Permission Manager instance | |
$queryHandler | RESTfulAPI_QueryHandler | Current QueryHandler instance | |
$serializer | RESTfulAPI_Serializer | Current serializer instance |
Property | Type | Description | |
---|---|---|---|
$instance | RESTfulAPI | Current RESTfulAPI instance |
Method | Description | |
---|---|---|
__construct ( ) | Constructor. | |
acl ( SS_HTTPRequest $request ) | Handles Access Control methods get response from API PermissionManager then passes it on to $answer() | |
answer ( string $json = null, boolean $corsPreflight = false ) | Output the API response to client then exit. | |
api_access_control ( string | DataObject $model, string $httpMethod = 'GET' ) : boolean | Checks a class or model api access depending on access_control_policy and the provided model. | |
auth ( SS_HTTPRequest $request ) | Handles authentications methods get response from API Authenticator then passes it on to $answer() | |
error ( RESTfulAPI_Error $error ) | Handles formatting and output error message then exit. | |
getqueryHandler ( ) : RESTfulAPI_QueryHandler | Returns current query handler instance | |
getserializer ( ) : RESTfulAPI_Serializer | Returns current serializer instance | |
index ( SS_HTTPRequest $request ) : string | Main API hub switch All requests pass through here and are redirected depending on HTTP verb and params | |
init ( ) | Controller inititalisation Catches CORS preflight request marked with HTTPMethod 'OPTIONS' |
Method | Description | |
---|---|---|
api_access_config_check ( string $className, string $httpMethod = 'GET' ) : boolean | Checks a model's api_access config. | |
model_permission_check ( string | DataObject $model, string $httpMethod = 'GET' ) : boolean | Checks a Model's permission for the currently authenticated user via the Permission Manager dependency. | |
setAnswerCORS ( SS_HTTPResponse $answer ) | Apply the proper CORS response heardes to an SS_HTTPResponse |
public acl ( SS_HTTPRequest $request ) | ||
$request | SS_HTTPRequest | HTTP request |
public auth ( SS_HTTPRequest $request ) | ||
$request | SS_HTTPRequest | HTTP request |
public error ( RESTfulAPI_Error $error ) | ||
$error | RESTfulAPI_Error | Error object to return |
public getqueryHandler ( ) : RESTfulAPI_QueryHandler | ||
return | RESTfulAPI_QueryHandler | QueryHandler instance |
public getserializer ( ) : RESTfulAPI_Serializer | ||
return | RESTfulAPI_Serializer | Serializer instance |
public init ( ) |
public RESTfulAPI_Authenticator $authenticator | ||
return | RESTfulAPI_Authenticator |
public RESTfulAPI_PermissionManager $authority | ||
return | RESTfulAPI_PermissionManager |
protected static RESTfulAPI $instance | ||
return | RESTfulAPI |
public RESTfulAPI_QueryHandler $queryHandler | ||
return | RESTfulAPI_QueryHandler |