GetUsersForRole gets the users that has a role.
(name string, domain ...string)
| 37 | |
| 38 | // GetUsersForRole gets the users that has a role. |
| 39 | func (e *Enforcer) GetUsersForRole(name string, domain ...string) ([]string, error) { |
| 40 | rm := e.GetRoleManager() |
| 41 | if rm == nil { |
| 42 | return nil, fmt.Errorf("role manager is not initialized") |
| 43 | } |
| 44 | res, err := rm.GetUsers(name, domain...) |
| 45 | return res, err |
| 46 | } |
| 47 | |
| 48 | // HasRoleForUser determines whether a user has a role. |
| 49 | func (e *Enforcer) HasRoleForUser(name string, role string, domain ...string) (bool, error) { |
nothing calls this directly
no test coverage detected