Leosac  0.8.0
Open Source Access Control
Leosac::Module::WebSockAPI::ICRUDResourceHandler Class Referenceabstract

A common interface for CRUD handler. More...

#include <CRUDResourceHandler.hpp>

+ Inheritance diagram for Leosac::Module::WebSockAPI::ICRUDResourceHandler:

Public Types

enum  Verb { Verb::CREATE, Verb::READ, Verb::UPDATE, Verb::DELETE }

Public Member Functions

boost::optional< jsonprocess (const ClientMessage &msg)

Protected Types

using ActionActionParam = std::pair< SecurityContext::Action, SecurityContext::ActionParam >
 A pair of Action and a generic ActionParam union. More...

Protected Member Functions

virtual UserSecurityContextsecurity_context () const =0
 Helper function that returns the security context. More...

Private Member Functions

virtual std::vector< ActionActionParamrequired_permission (Verb verb, const json &req) const =0
virtual boost::optional< jsoncreate_impl (const json &req)=0
virtual boost::optional< jsonread_impl (const json &req)=0
virtual boost::optional< jsonupdate_impl (const json &req)=0
virtual boost::optional< jsondelete_impl (const json &req)=0
void enforce_permission (const std::vector< ActionActionParam > &)

Static Private Member Functions

static Verb verb_from_request_type (const std::string &)

Detailed Description

A common interface for CRUD handler.

Definition at line 40 of file CRUDResourceHandler.hpp.

Member Typedef Documentation

◆ ActionActionParam

A pair of Action and a generic ActionParam union.

Definition at line 57 of file CRUDResourceHandler.hpp.

Member Enumeration Documentation

◆ Verb


Definition at line 43 of file CRUDResourceHandler.hpp.

Member Function Documentation

◆ create_impl()

◆ delete_impl()

◆ enforce_permission()

void ICRUDResourceHandler::enforce_permission ( const std::vector< ActionActionParam > &  permissions)

Definition at line 50 of file CRUDResourceHandler.cpp.

◆ process()

boost::optional< json > ICRUDResourceHandler::process ( const ClientMessage msg)

Definition at line 64 of file CRUDResourceHandler.cpp.

◆ read_impl()

◆ required_permission()

◆ security_context()

virtual UserSecurityContext& Leosac::Module::WebSockAPI::ICRUDResourceHandler::security_context ( ) const
protectedpure virtual

Helper function that returns the security context.

Implemented in Leosac::Module::WebSockAPI::ExternalCRUDResourceHandler, and Leosac::Module::WebSockAPI::CRUDResourceHandler.

◆ update_impl()

◆ verb_from_request_type()

ICRUDResourceHandler::Verb ICRUDResourceHandler::verb_from_request_type ( const std::string &  req)

Definition at line 32 of file CRUDResourceHandler.cpp.

The documentation for this class was generated from the following files: