A SecurityContext with no permission.
A SecurityContext object for users.
bool can_read_membership(const MembershipActionParam &map) const
bool can_administrate_group(const GroupActionParam &gap) const
bool can_read_group(const GroupActionParam &gap) const
UserSecurityContext(DBServicePtr dbsrv, Auth::UserId id)
bool is_manager() const
Helper function that returns true if the user is at least manager.
Auth::UserId user_id() const
bool can_read_door(const DoorActionParam &dap) const
bool can_read_credential(const CredentialActionParam &cap) const
bool can_read_user(const UserActionParam &uap) const
Username, as well as a few basic (firstname, lastname) info are public.
bool can_update_user(const UserActionParam &uap) const
bool is_self(Auth::UserId id) const
Return true if the owner of the security context is the user whose id is id.
bool is_admin() const
Helper function that returns true if the user is an administrator.
bool can_read_user_detail(const UserActionParam &uap) const
virtual bool check_permission_impl(Action a, const ActionParam &ap) const override
Reimplement this method to provide permission checking.
bool can_read_schedule(const ScheduleActionParam &sap) const
bool can_delete_membership(const MembershipActionParam &map) const
Can we leave/kick someone from a group.
virtual bool check_permission_impl(Action a, const ActionParam &ap) const override
Reimplement this method to provide permission checking.
bool can_create_membership(const MembershipActionParam &map) const
A SecurityContext is used to query permission while doing an operation.