SiteBuiltInRoles lists all roles that can be applied to a user. This is the list of available roles, and not specific to a user This should be a list in a database, but until then we build the list from the builtins.
()
| 901 | // This should be a list in a database, but until then we build |
| 902 | // the list from the builtins. |
| 903 | func SiteBuiltInRoles() []Role { |
| 904 | var roles []Role |
| 905 | for _, roleF := range builtInRoles { |
| 906 | // Must provide some non-nil uuid to filter out org roles. |
| 907 | role := roleF(uuid.New()) |
| 908 | if !role.Identifier.IsOrgRole() { |
| 909 | roles = append(roles, role) |
| 910 | } |
| 911 | } |
| 912 | return roles |
| 913 | } |
| 914 | |
| 915 | // ChangeRoleSet is a helper function that finds the difference of 2 sets of |
| 916 | // roles. When setting a user's new roles, it is equivalent to adding and |