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

A SecurityContext with no permission. More...

#include <UserSecurityContext.hpp>

+ Inheritance diagram for Leosac::NullSecurityContext:
+ Collaboration diagram for Leosac::NullSecurityContext:

Public Member Functions

 NullSecurityContext ()
 
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::UserSecurityContext
 UserSecurityContext (DBServicePtr dbsrv, Auth::UserId id)
 
bool is_self (Auth::UserId id) const
 Return true if the owner of the security context is the user whose id is id. More...
 
Auth::UserId user_id () const
 
Auth::UserPtr self () const
 Load the User object that owns this security context. 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...
 

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 SecurityContext with no permission.

Definition at line 98 of file UserSecurityContext.hpp.

Constructor & Destructor Documentation

◆ NullSecurityContext()

NullSecurityContext::NullSecurityContext ( )

Definition at line 335 of file UserSecurityContext.cpp.

Member Function Documentation

◆ check_permission_impl()

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

Reimplement this method to provide permission checking.

Reimplemented from Leosac::UserSecurityContext.

Definition at line 340 of file UserSecurityContext.cpp.


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