Leosac
0.8.0
Open Source Access Control
|
A common interface for CRUD handler. More...
#include <CRUDResourceHandler.hpp>
Public Types | |
enum | Verb { Verb::CREATE, Verb::READ, Verb::UPDATE, Verb::DELETE } |
Public Member Functions | |
boost::optional< json > | process (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 UserSecurityContext & | security_context () const =0 |
Helper function that returns the security context. More... | |
Private Member Functions | |
virtual std::vector< ActionActionParam > | required_permission (Verb verb, const json &req) const =0 |
virtual boost::optional< json > | create_impl (const json &req)=0 |
virtual boost::optional< json > | read_impl (const json &req)=0 |
virtual boost::optional< json > | update_impl (const json &req)=0 |
virtual boost::optional< json > | delete_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 &) |
A common interface for CRUD handler.
Definition at line 40 of file CRUDResourceHandler.hpp.
|
protected |
A pair of Action and a generic ActionParam union.
Definition at line 57 of file CRUDResourceHandler.hpp.
Enumerator | |
---|---|
CREATE | |
READ | |
UPDATE | |
DELETE |
Definition at line 43 of file CRUDResourceHandler.hpp.
|
privatepure virtual |
Implemented in Leosac::Module::LedBuzzer::CRUDHandler< ObjectT, ObjectIdKey, SerializerT >, Leosac::Module::Piface::CRUDHandler, Leosac::Module::Wiegand::CRUDHandler, Leosac::Module::WebSockAPI::CredentialCRUD, Leosac::Module::WebSockAPI::GroupCRUD, Leosac::Module::WebSockAPI::ScheduleCRUD, Leosac::Module::WebSockAPI::MembershipCRUD, Leosac::Module::WebSockAPI::AccessPointCRUD, Leosac::Module::WebSockAPI::DoorCRUD, Leosac::Module::WebSockAPI::ZoneCRUD, and Leosac::Module::WebSockAPI::UserCRUD.
|
privatepure virtual |
Implemented in Leosac::Module::LedBuzzer::CRUDHandler< ObjectT, ObjectIdKey, SerializerT >, Leosac::Module::Piface::CRUDHandler, Leosac::Module::Wiegand::CRUDHandler, Leosac::Module::WebSockAPI::GroupCRUD, Leosac::Module::WebSockAPI::ScheduleCRUD, Leosac::Module::WebSockAPI::UserCRUD, Leosac::Module::WebSockAPI::MembershipCRUD, Leosac::Module::WebSockAPI::CredentialCRUD, Leosac::Module::WebSockAPI::AccessPointCRUD, Leosac::Module::WebSockAPI::DoorCRUD, and Leosac::Module::WebSockAPI::ZoneCRUD.
|
private |
Definition at line 50 of file CRUDResourceHandler.cpp.
boost::optional< json > ICRUDResourceHandler::process | ( | const ClientMessage & | msg | ) |
Definition at line 64 of file CRUDResourceHandler.cpp.
|
privatepure virtual |
Implemented in Leosac::Module::LedBuzzer::CRUDHandler< ObjectT, ObjectIdKey, SerializerT >, Leosac::Module::Piface::CRUDHandler, Leosac::Module::Wiegand::CRUDHandler, Leosac::Module::WebSockAPI::GroupCRUD, Leosac::Module::WebSockAPI::MembershipCRUD, Leosac::Module::WebSockAPI::CredentialCRUD, Leosac::Module::WebSockAPI::ScheduleCRUD, Leosac::Module::WebSockAPI::UserCRUD, Leosac::Module::WebSockAPI::AccessPointCRUD, Leosac::Module::WebSockAPI::DoorCRUD, and Leosac::Module::WebSockAPI::ZoneCRUD.
|
privatepure virtual |
Implemented in Leosac::Module::LedBuzzer::CRUDHandler< ObjectT, ObjectIdKey, SerializerT >, Leosac::Module::Piface::CRUDHandler, Leosac::Module::Wiegand::CRUDHandler, Leosac::Module::WebSockAPI::AccessPointCRUD, Leosac::Module::WebSockAPI::CredentialCRUD, Leosac::Module::WebSockAPI::DoorCRUD, Leosac::Module::WebSockAPI::GroupCRUD, Leosac::Module::WebSockAPI::ScheduleCRUD, Leosac::Module::WebSockAPI::ZoneCRUD, Leosac::Module::WebSockAPI::MembershipCRUD, and Leosac::Module::WebSockAPI::UserCRUD.
|
protectedpure virtual |
Helper function that returns the security context.
Implemented in Leosac::Module::WebSockAPI::ExternalCRUDResourceHandler, and Leosac::Module::WebSockAPI::CRUDResourceHandler.
|
privatepure virtual |
Implemented in Leosac::Module::LedBuzzer::CRUDHandler< ObjectT, ObjectIdKey, SerializerT >, Leosac::Module::Piface::CRUDHandler, Leosac::Module::Wiegand::CRUDHandler, Leosac::Module::WebSockAPI::GroupCRUD, Leosac::Module::WebSockAPI::ScheduleCRUD, Leosac::Module::WebSockAPI::UserCRUD, Leosac::Module::WebSockAPI::MembershipCRUD, Leosac::Module::WebSockAPI::CredentialCRUD, Leosac::Module::WebSockAPI::AccessPointCRUD, Leosac::Module::WebSockAPI::DoorCRUD, and Leosac::Module::WebSockAPI::ZoneCRUD.
|
staticprivate |
Definition at line 32 of file CRUDResourceHandler.cpp.