Leosac  0.8.0
Open Source Access Control
Leosac::Module::WebSockAPI::CredentialCRUD Class Reference

CRUD Handler for credentials. More...

#include <CredentialCRUD.hpp>

+ Inheritance diagram for Leosac::Module::WebSockAPI::CredentialCRUD:
+ Collaboration diagram for Leosac::Module::WebSockAPI::CredentialCRUD:

Static Public Member Functions

static CRUDResourceHandlerUPtr instanciate (RequestContext)
 
- Static Public Member Functions inherited from Leosac::Module::WebSockAPI::CRUDResourceHandler
static CRUDResourceHandlerUPtr instanciate (RequestContext)
 

Private Member Functions

 CredentialCRUD (RequestContext ctx)
 
virtual std::vector< ActionActionParamrequired_permission (Verb verb, const json &req) const override
 
virtual boost::optional< jsoncreate_impl (const json &req) override
 Create a new credential. More...
 
virtual boost::optional< jsonread_impl (const json &req) override
 
virtual boost::optional< jsonupdate_impl (const json &req) override
 
virtual boost::optional< jsondelete_impl (const json &req) override
 

Additional Inherited Members

- Public Types inherited from Leosac::Module::WebSockAPI::CRUDResourceHandler
using Factory = CRUDResourceHandlerUPtr(*)(RequestContext)
 
- Public Types inherited from Leosac::Module::WebSockAPI::ICRUDResourceHandler
enum  Verb { Verb::CREATE, Verb::READ, Verb::UPDATE, Verb::DELETE }
 
- Public Member Functions inherited from Leosac::Module::WebSockAPI::ICRUDResourceHandler
boost::optional< jsonprocess (const ClientMessage &msg)
 
- Protected Types inherited from Leosac::Module::WebSockAPI::ICRUDResourceHandler
using ActionActionParam = std::pair< SecurityContext::Action, SecurityContext::ActionParam >
 A pair of Action and a generic ActionParam union. More...
 
- Protected Member Functions inherited from Leosac::Module::WebSockAPI::CRUDResourceHandler
 CRUDResourceHandler (RequestContext ctx)
 
virtual UserSecurityContextsecurity_context () const override
 Helper function that returns the security context. More...
 
- Protected Attributes inherited from Leosac::Module::WebSockAPI::CRUDResourceHandler
RequestContext ctx_
 

Detailed Description

CRUD Handler for credentials.

This handler is designed to be able to manage various type of credentials.

See also
See the *_impl() method for each requests parameters/response.

Definition at line 39 of file CredentialCRUD.hpp.

Constructor & Destructor Documentation

◆ CredentialCRUD()

CredentialCRUD::CredentialCRUD ( RequestContext  ctx)
private

Definition at line 38 of file CredentialCRUD.cpp.

Member Function Documentation

◆ create_impl()

boost::optional< json > CredentialCRUD::create_impl ( const json req)
overrideprivatevirtual

Create a new credential.

Request:

  • credential-type: The type of the credential we wish to create. Can be rfid-card.
  • attributes: Dictionary of attributes for the credential.
Parameters
req
Returns

Implements Leosac::Module::WebSockAPI::ICRUDResourceHandler.

Definition at line 82 of file CredentialCRUD.cpp.

◆ delete_impl()

boost::optional< json > CredentialCRUD::delete_impl ( const json req)
overrideprivatevirtual

◆ instanciate()

CRUDResourceHandlerUPtr CredentialCRUD::instanciate ( RequestContext  ctx)
static

Definition at line 43 of file CredentialCRUD.cpp.

◆ read_impl()

boost::optional< json > CredentialCRUD::read_impl ( const json req)
overrideprivatevirtual

◆ required_permission()

std::vector< CRUDResourceHandler::ActionActionParam > CredentialCRUD::required_permission ( CRUDResourceHandler::Verb  verb,
const json req 
) const
overrideprivatevirtual

◆ update_impl()

boost::optional< json > CredentialCRUD::update_impl ( const json req)
overrideprivatevirtual

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