chore(CommunityPermissions): Disable granting admin permission for non-owners
This commit is contained in:
parent
878a7ba657
commit
e2dadeb15e
|
@ -25,6 +25,8 @@ SplitView {
|
|||
topMargin: 50
|
||||
}
|
||||
store: CommunitiesStore {
|
||||
readonly property bool isOwner: isOwnerCheckBox.checked
|
||||
|
||||
assetsModel: AssetsModel {}
|
||||
collectiblesModel: CollectiblesModel {}
|
||||
channelsModel: ListModel {
|
||||
|
@ -80,6 +82,12 @@ SplitView {
|
|||
SplitView.preferredHeight: 150
|
||||
|
||||
logsView.logText: logs.logText
|
||||
|
||||
CheckBox {
|
||||
id: isOwnerCheckBox
|
||||
|
||||
text: "Is owner"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@ import StatusQ.Controls 0.1
|
|||
import QtQuick 2.14
|
||||
import QtQuick.Controls 2.14
|
||||
|
||||
import utils 1.0
|
||||
|
||||
StatusListItem {
|
||||
id: root
|
||||
|
||||
|
@ -22,10 +24,17 @@ StatusListItem {
|
|||
asset.bgWidth: 32
|
||||
asset.bgHeight: 32
|
||||
|
||||
Binding on asset.color {
|
||||
when: !root.enabled
|
||||
value: Style.current.darkGrey
|
||||
}
|
||||
|
||||
components: [
|
||||
StatusRadioButton {
|
||||
id: radioButton
|
||||
|
||||
visible: root.enabled
|
||||
|
||||
// reference to root for better integration with ButtonGroup
|
||||
// by accessing main component via ButtonGroup::checkedButton.item
|
||||
readonly property alias item: root
|
||||
|
|
|
@ -15,6 +15,8 @@ StatusDropdown {
|
|||
property int mode: PermissionsDropdown.Mode.Add
|
||||
property int initialPermissionType: PermissionTypes.Type.None
|
||||
|
||||
property bool disableAdminPermission: false
|
||||
|
||||
enum Mode {
|
||||
Add, Update
|
||||
}
|
||||
|
@ -93,6 +95,8 @@ StatusDropdown {
|
|||
checked: d.initialPermissionType === permissionType
|
||||
buttonGroup: group
|
||||
|
||||
enabled: !root.disableAdminPermission
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@ import QtQuick 2.0
|
|||
QtObject {
|
||||
id: root
|
||||
|
||||
readonly property bool isOwner: false
|
||||
|
||||
property var permissionsModel: ListModel {} // Backend permissions list object model assignment. Please check the current expected data in qml defined in `createPermissions` method
|
||||
property var permissionConflict: QtObject { // Backend conflicts object model assignment. Now mocked data.
|
||||
property bool exists: false
|
||||
|
|
|
@ -414,6 +414,7 @@ StatusScrollView {
|
|||
id: permissionsDropdown
|
||||
|
||||
initialPermissionType: d.permissionType
|
||||
disableAdminPermission: !root.store.isOwner
|
||||
|
||||
onDone: {
|
||||
d.permissionType = permissionType
|
||||
|
|
Loading…
Reference in New Issue