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

CRUD Handler for schedules. More...

#include <ScheduleCRUD.hpp>

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

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

 ScheduleCRUD (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 schedule. More...
 
virtual boost::optional< jsonread_impl (const json &req) override
 
virtual boost::optional< jsonupdate_impl (const json &req) override
 Update a schedule object. More...
 
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 schedules.

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

Definition at line 36 of file ScheduleCRUD.hpp.

Constructor & Destructor Documentation

◆ ScheduleCRUD()

ScheduleCRUD::ScheduleCRUD ( RequestContext  ctx)
private

Definition at line 37 of file ScheduleCRUD.cpp.

Member Function Documentation

◆ create_impl()

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

Create a new schedule.

Request:

  • attributes: Various attributes regarding the schedules.

Attributes:

  • name:
  • description:
  • timeframes:

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

Definition at line 81 of file ScheduleCRUD.cpp.

◆ delete_impl()

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

◆ instanciate()

CRUDResourceHandlerUPtr ScheduleCRUD::instanciate ( RequestContext  ctx)
static

Definition at line 42 of file ScheduleCRUD.cpp.

◆ read_impl()

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

◆ required_permission()

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

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

Definition at line 50 of file ScheduleCRUD.cpp.

◆ update_impl()

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

Update a schedule object.

This call is a bit different than schedule.create because it allows for specifying the mapping (ScheduleMapping objects) of the schedule.

Request:

  • attributes: ...
  • mapping: [ {
    • alias: Alias of this mapping
    • groups: [IDs, ...] Ids of groups targeted by the mapping
    • users: [IDs, ...] Ditto for users
    • credentials: [IDs, ...] Ditto for credentials. } ]

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

Definition at line 159 of file ScheduleCRUD.cpp.


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