Leosac  0.8.0
Open Source Access Control
Leosac::SystemSecurityContext Class Reference

A security context for system operation. More...

#include <SecurityContext.hpp>

+ Inheritance diagram for Leosac::SystemSecurityContext:
+ Collaboration diagram for Leosac::SystemSecurityContext:

Public Member Functions

 SystemSecurityContext (DBServicePtr dbsrv)
 
virtual bool check_permission_impl (Action a, const ActionParam &ap) const override
 Reimplement this method to provide permission checking. More...
 
- Public Member Functions inherited from Leosac::SecurityContext
 SecurityContext (DBServicePtr dbsrv)
 
virtual ~SecurityContext ()=default
 
virtual bool check_permission (Action a, const ActionParam &ap) const
 Check for the permission to perform action a with parameters ap. More...
 
bool check_permission (Action a) const
 Check for the permission to perform a given action. More...
 
void enforce_permission (Action a, const ActionParam &ap) const
 Similar to check_permission(), but throws is the permission is denied. More...
 
void enforce_permission (Action a) const
 Make sure that we have the permission to perform action a, otherwise throws. More...
 

Static Public Member Functions

static SecurityContextinstance ()
 

Additional Inherited Members

- Public Types inherited from Leosac::SecurityContext
enum  Action {
  Action::IS_ADMIN, Action::IS_MANAGER, Action::USER_CREATE, Action::USER_READ,
  Action::USER_READ_EMAIL, Action::USER_UPDATE, Action::USER_CHANGE_PASSWORD, Action::USER_SEARCH,
  Action::USER_UPDATE_RANK, Action::USER_MANAGE_VALIDITY, Action::USER_DELETE, Action::GROUP_CREATE,
  Action::GROUP_READ, Action::GROUP_UPDATE, Action::GROUP_DELETE, Action::GROUP_SEARCH,
  Action::GROUP_LIST_MEMBERSHIP, Action::GROUP_MEMBERSHIP_JOINED, Action::GROUP_MEMBERSHIP_LEFT, Action::MEMBERSHIP_READ,
  Action::CREDENTIAL_READ, Action::CREDENTIAL_UPDATE, Action::CREDENTIAL_CREATE, Action::CREDENTIAL_DELETE,
  Action::SCHEDULE_READ, Action::SCHEDULE_UPDATE, Action::SCHEDULE_CREATE, Action::SCHEDULE_DELETE,
  Action::SCHEDULE_SEARCH, Action::DOOR_READ, Action::DOOR_UPDATE, Action::DOOR_CREATE,
  Action::DOOR_DELETE, Action::DOOR_SEARCH, Action::ACCESS_POINT_READ, Action::ACCESS_POINT_CREATE,
  Action::ACCESS_POINT_UPDATE, Action::ACCESS_POINT_DELETE, Action::ACCESS_POINT_SEARCH, Action::ZONE_READ,
  Action::ZONE_UPDATE, Action::ZONE_CREATE, Action::ZONE_DELETE, Action::ZONE_SEARCH,
  Action::SMTP_GETCONFIG, Action::SMTP_SETCONFIG, Action::SMTP_SENDMAIL, Action::LOG_READ,
  Action::AUDIT_READ, Action::AUDIT_READ_FULL, Action::ACCESS_OVERVIEW, Action::RESTART_SERVER,
  Action::HARDWARE_READ, Action::HARDWARE_UPDATE, Action::HARDWARE_CREATE, Action::HARDWARE_DELETE,
  Action::HARDWARE_SEARCH
}
 
- Protected Attributes inherited from Leosac::SecurityContext
DBServicePtr dbsrv_
 

Detailed Description

A security context for system operation.

Basically, this security context always grants all permissions.

Definition at line 287 of file SecurityContext.hpp.

Constructor & Destructor Documentation

◆ SystemSecurityContext()

SystemSecurityContext::SystemSecurityContext ( DBServicePtr  dbsrv)
explicit

Definition at line 53 of file SecurityContext.cpp.

Member Function Documentation

◆ check_permission_impl()

bool SystemSecurityContext::check_permission_impl ( Action  a,
const ActionParam ap 
) const
overridevirtual

Reimplement this method to provide permission checking.

Implements Leosac::SecurityContext.

Definition at line 58 of file SecurityContext.cpp.

◆ instance()

SecurityContext & SystemSecurityContext::instance ( )
static

Definition at line 64 of file SecurityContext.cpp.


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