static SecurityContext & instance()
SecurityContext & sec
The SecurityContext of the caller.
ScheduleActionParam sched
virtual bool check_permission(Action a, const ActionParam &ap) const
Check for the permission to perform action a with parameters ap.
A security context for system operation.
Hardware::DeviceId device_id
@ ACCESS_OVERVIEW
Overview of users/doors access permission.
AccessPointActionParam access_point
Auth::UserGroupMembershipId membership_id
Cred::CredentialId credential_id
@ SMTP_GETCONFIG
Retrieve SMTP configuration.
@ IS_ADMIN
A workaround permission that requires the user to be administrator.
virtual bool check_permission_impl(Action a, const ActionParam &ap) const override
Reimplement this method to provide permission checking.
@ RESTART_SERVER
Perform to restart the Leosac server.
@ HARDWARE_READ
Permissions for hardware devices.
Tools::ScheduleId schedule_id
virtual bool check_permission_impl(Action a, const ActionParam &ap) const =0
Reimplement this method to provide permission checking.
An ExecutionContext is passed around to service so they have context about who is making the call and...
virtual ~SecurityContext()=default
@ SMTP_SETCONFIG
Edit the SMTP configuration.
@ IS_MANAGER
Requires that the user be at least manager.
MembershipActionParam membership
HardwareDeviceActionParam device
Audit::IAuditEntryPtr audit
An optional audit object that would act as parent for the audit trail.
Auth::AccessPointId ap_id
void enforce_permission(Action a, const ActionParam &ap) const
Similar to check_permission(), but throws is the permission is denied.
@ GROUP_LIST_MEMBERSHIP
Ability to list member of a group.
@ USER_UPDATE_RANK
Editing rank means being able to become administrator.
SecurityContext(DBServicePtr dbsrv)
@ USER_MANAGE_VALIDITY
Can we enable/disable the user or change its validity period ?
CredentialActionParam cred
@ AUDIT_READ_FULL
Read the audit log and access additional information, such as the JSON "before" and "after" field.
A SecurityContext is used to query permission while doing an operation.
ExecutionContext(SecurityContext &sc)
SystemSecurityContext(DBServicePtr dbsrv)