HasRoleForUser determines whether a user has a role.
(name string, role string, domain ...string)
| 30 | |
| 31 | // HasRoleForUser determines whether a user has a role. |
| 32 | func (e *SyncedEnforcer) HasRoleForUser(name string, role string, domain ...string) (bool, error) { |
| 33 | e.m.RLock() |
| 34 | defer e.m.RUnlock() |
| 35 | return e.Enforcer.HasRoleForUser(name, role, domain...) |
| 36 | } |
| 37 | |
| 38 | // AddRoleForUser adds a role for a user. |
| 39 | // Returns false if the user already has the role (aka not affected). |
nothing calls this directly
no test coverage detected