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