Leosac
0.8.0
Open Source Access Control
|
A SecurityContext object for users. More...
#include <UserSecurityContext.hpp>
Public Member Functions | |
UserSecurityContext (DBServicePtr dbsrv, Auth::UserId id) | |
virtual bool | check_permission_impl (Action a, const ActionParam &ap) const override |
Reimplement this method to provide permission checking. More... | |
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... | |
Private Member Functions | |
bool | can_read_group (const GroupActionParam &gap) const |
bool | can_administrate_group (const GroupActionParam &gap) const |
bool | can_read_membership (const MembershipActionParam &map) const |
bool | can_read_user (const UserActionParam &uap) const |
Username, as well as a few basic (firstname, lastname) info are public. More... | |
bool | can_read_user_detail (const UserActionParam &uap) const |
bool | can_update_user (const UserActionParam &uap) const |
bool | can_create_membership (const MembershipActionParam &map) const |
bool | can_delete_membership (const MembershipActionParam &map) const |
Can we leave/kick someone from a group. More... | |
bool | can_read_credential (const CredentialActionParam &cap) const |
bool | can_read_schedule (const ScheduleActionParam &sap) const |
bool | can_read_door (const DoorActionParam &dap) const |
bool | is_admin () const |
Helper function that returns true if the user is an administrator. More... | |
bool | is_manager () const |
Helper function that returns true if the user is at least manager. More... | |
Private Attributes | |
Auth::UserId | user_id_ |
A SecurityContext object for users.
Definition at line 31 of file UserSecurityContext.hpp.
UserSecurityContext::UserSecurityContext | ( | DBServicePtr | dbsrv, |
Auth::UserId | id | ||
) |
Definition at line 32 of file UserSecurityContext.cpp.
|
private |
Definition at line 161 of file UserSecurityContext.cpp.
|
private |
Definition at line 205 of file UserSecurityContext.cpp.
|
private |
Can we leave/kick someone from a group.
Definition at line 225 of file UserSecurityContext.cpp.
|
private |
Definition at line 292 of file UserSecurityContext.cpp.
|
private |
Definition at line 274 of file UserSecurityContext.cpp.
|
private |
Definition at line 151 of file UserSecurityContext.cpp.
|
private |
Definition at line 176 of file UserSecurityContext.cpp.
|
private |
Definition at line 253 of file UserSecurityContext.cpp.
|
private |
Username, as well as a few basic (firstname, lastname) info are public.
Definition at line 188 of file UserSecurityContext.cpp.
|
private |
Definition at line 194 of file UserSecurityContext.cpp.
|
private |
Definition at line 199 of file UserSecurityContext.cpp.
|
overridevirtual |
Reimplement this method to provide permission checking.
Implements Leosac::SecurityContext.
Reimplemented in Leosac::NullSecurityContext.
Definition at line 38 of file UserSecurityContext.cpp.
|
private |
Helper function that returns true if the user is an administrator.
Definition at line 304 of file UserSecurityContext.cpp.
|
private |
Helper function that returns true if the user is at least manager.
Definition at line 312 of file UserSecurityContext.cpp.
bool UserSecurityContext::is_self | ( | Auth::UserId | id | ) | const |
Return true if the owner of the security context is the user whose id is id
.
Definition at line 320 of file UserSecurityContext.cpp.
Auth::UserPtr UserSecurityContext::self | ( | ) | const |
Load the User object that owns this security context.
Definition at line 330 of file UserSecurityContext.cpp.
Auth::UserId UserSecurityContext::user_id | ( | ) | const |
Definition at line 325 of file UserSecurityContext.cpp.
|
private |
Definition at line 91 of file UserSecurityContext.hpp.