[MM-20061] Add System Admin filter to both LDAP and SAML (#13534)
* promote user to admin upon login * Add SAML support for admin accounts * update en.json * update i18n * Add tests as per comments * change function name * fix config.go * invalidate cache so its not checking for cache when roles change * add enable attribute and filter
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5f7ca55b13
Коммит
dc24c9abe8
@@ -633,6 +633,10 @@ func (u *User) IsGuest() bool {
|
||||
return IsInRole(u.Roles, SYSTEM_GUEST_ROLE_ID)
|
||||
}
|
||||
|
||||
func (u *User) IsSystemAdmin() bool {
|
||||
return IsInRole(u.Roles, SYSTEM_ADMIN_ROLE_ID)
|
||||
}
|
||||
|
||||
// Make sure you acually want to use this function. In context.go there are functions to check permissions
|
||||
// This function should not be used to check permissions.
|
||||
func (u *User) IsInRole(inRole string) bool {
|
||||
|
||||
Ссылка в новой задаче
Block a user