Prevent unlocking yourself as admin user
This commit is contained in:
parent
fb70e12cbb
commit
17b321fc10
@ -37,7 +37,6 @@ SettingsPageBase {
|
||||
popup.open()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
@ -361,8 +360,10 @@ SettingsPageBase {
|
||||
Layout.fillWidth: true
|
||||
text: model.text
|
||||
checked: (userDetailsPage.userInfo.scopes & model.scope) === model.scope
|
||||
enabled: model.scope === UserInfo.PermissionScopeAdmin ||
|
||||
((userDetailsPage.userInfo.scopes & UserInfo.PermissionScopeAdmin) !== UserInfo.PermissionScopeAdmin)
|
||||
|
||||
enabled: model.scope === UserInfo.PermissionScopeAdmin && userDetailsPage.userInfo.username == userManager.userInfo.username ?
|
||||
false : model.scope === UserInfo.PermissionScopeAdmin ||
|
||||
((userDetailsPage.userInfo.scopes & UserInfo.PermissionScopeAdmin) !== UserInfo.PermissionScopeAdmin)
|
||||
onClicked: {
|
||||
print("scopes:", userDetailsPage.userInfo.scopes)
|
||||
var scopes = userDetailsPage.userInfo.scopes
|
||||
@ -465,12 +466,10 @@ SettingsPageBase {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SettingsPageSectionHeader {
|
||||
text: qsTr("Permissions")
|
||||
}
|
||||
|
||||
|
||||
Repeater {
|
||||
id: scopesRepeater
|
||||
model: NymeaUtils.scopesModel
|
||||
|
||||
Reference in New Issue
Block a user