mirror of
https://github.com/plankanban/planka.git
synced 2025-12-18 01:11:13 +03:00
fix: Disable role change when OIDC roles are not ignored
This commit is contained in:
@@ -110,12 +110,13 @@ module.exports = {
|
||||
tableName: 'user_account',
|
||||
|
||||
customToJSON() {
|
||||
const isLockedAdmin = this.email === sails.config.custom.defaultAdminEmail;
|
||||
const isDefaultAdmin = this.email === sails.config.custom.defaultAdminEmail;
|
||||
|
||||
return {
|
||||
..._.omit(this, ['password', 'isSso', 'avatar', 'passwordChangedAt']),
|
||||
isLockedAdmin,
|
||||
isLocked: this.isSso || isLockedAdmin,
|
||||
isLocked: this.isSso || isDefaultAdmin,
|
||||
isRoleLocked: (this.isSso && !sails.config.custom.oidcIgnoreRoles) || isDefaultAdmin,
|
||||
isDeletionLocked: isDefaultAdmin,
|
||||
avatarUrl:
|
||||
this.avatar &&
|
||||
`${sails.config.custom.userAvatarsUrl}/${this.avatar.dirname}/square-100.${this.avatar.extension}`,
|
||||
|
||||
Reference in New Issue
Block a user