App::Base
Inherits App::Pagination < ActionController::Base < ActionController::Responders < ActionController::Route::Builder < Reference < Object
Constants
Log = ::App::Log.for("controller")
Configure your log source name NOTE:: this is chaining from Log
PARSER_LIST = ["application/json"]
RESPONDER_LIST = ["application/json", "text/html"]
Instance methods
audit_log(action : String, resource_type : String, resource_id : UUID | Nil = nil, organization : Models::Organization | Nil = nil, details : Hash(String, JSON::Any::Type) | Nil = nil)
Log an audit event
bad_media_type(error) : AC::Error::ContentResponse
covers no acceptable response format and not an acceptable post format
build_search_params(query : String = "*", limit : UInt32 = DEFAULT_LIMIT, offset : UInt32 = 0_u32, sort : String = "name", order : String = "asc", ref : String | Nil = nil, fields : Array(String) = [] of String)
Sourcehas_permission?(org : Models::Organization, min_permission : Permissions) : Bool
Check if user has at least the specified permission level
invalid_param(error) : AC::Error::ParameterResponse
handles paramater missing or a bad paramater value / format
jwt_scopes
Get JWT token scopes (if authenticated via JWT) Returns array of scopes from JWT token, or empty array
require_permission!(org : Models::Organization, min_permission : Permissions)
Require specific permission level in organization
search_params
Sourcesearch_params?
Sourceset_date_header
Sourceset_request_id
This makes it simple to match client requests with server side logs. When building microservices this ID should be propagated to upstream services.
user_permission_in_org(org : Models::Organization) : Permissions | Nil
Get user's permission in an organization