fix(Communities): ensure permission CTAs are rendered with admin

permissions

This commit fixes a bug that admins are not able to do any permission
actions (editing/deleting). The issue was that there was a check for
those CTAs only to be visible if the logged-in user is the owner of the
community, not an admin.

Closes #11092
This commit is contained in:
Pascal Precht 2023-06-29 09:37:49 +02:00 committed by r4bbit
parent 74991820ca
commit 42e0751e83
2 changed files with 3 additions and 2 deletions

View File

@ -601,6 +601,7 @@ StatusSectionLayout {
readonly property string image: root.community.image readonly property string image: root.community.image
readonly property string color: root.community.color readonly property string color: root.community.color
readonly property bool owner: root.community.memberRole === Constants.memberRole.owner readonly property bool owner: root.community.memberRole === Constants.memberRole.owner
readonly property bool admin: root.community.memberRole === Constants.memberRole.admin
} }
function goTo(section: int, subSection: int) { function goTo(section: int, subSection: int) {

View File

@ -18,7 +18,7 @@ StatusScrollView {
required property var collectiblesModel required property var collectiblesModel
required property var channelsModel required property var channelsModel
// id, name, image, color, owner properties expected // id, name, image, color, owner, admin properties expected
required property var communityDetails required property var communityDetails
property int viewWidth: 560 // by design property int viewWidth: 560 // by design
@ -97,7 +97,7 @@ StatusScrollView {
? channelsSelectionModel : communityItemModel ? channelsSelectionModel : communityItemModel
isPrivate: model.isPrivate isPrivate: model.isPrivate
showButtons: root.communityDetails.owner showButtons: root.communityDetails.owner || (root.communityDetails.admin && model.permissionType !== PermissionTypes.Type.Admin)
onEditClicked: root.editPermissionRequested(model.index) onEditClicked: root.editPermissionRequested(model.index)
onDuplicateClicked: root.duplicatePermissionRequested(model.index) onDuplicateClicked: root.duplicatePermissionRequested(model.index)