2023-03-07 08:47:04 +00:00
|
|
|
import QtQml 2.15
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
required property string activeSectionId
|
|
|
|
required property var chatCommunitySectionModuleInst
|
|
|
|
|
|
|
|
readonly property var permissionsModel:
|
|
|
|
chatCommunitySectionModuleInst.permissionsModel
|
|
|
|
|
|
|
|
readonly property bool isOwner: false
|
|
|
|
|
2023-03-07 16:51:06 +00:00
|
|
|
readonly property bool allTokenRequirementsMet: chatCommunitySectionModuleInst.allTokenRequirementsMet
|
|
|
|
|
2023-03-07 08:47:04 +00:00
|
|
|
readonly property QtObject _d: QtObject {
|
|
|
|
id: d
|
|
|
|
|
|
|
|
function createPermissionEntry(holdings, permissionType, isPrivate,
|
|
|
|
channels) {
|
|
|
|
return {
|
|
|
|
holdingsListModel: holdings,
|
|
|
|
channelsListModel: channels,
|
|
|
|
permissionType,
|
|
|
|
isPrivate
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function createOrEdit(key, holdings, permissionType, isPrivate,
|
|
|
|
channels) {
|
|
|
|
|
|
|
|
root.chatCommunitySectionModuleInst.createOrEditCommunityTokenPermission(
|
|
|
|
root.activeSectionId, key,
|
|
|
|
permissionType,
|
|
|
|
JSON.stringify(holdings),
|
|
|
|
isPrivate)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function createPermission(holdings, permissionType, isPrivate, channels) {
|
|
|
|
d.createOrEdit("", holdings, permissionType, isPrivate, channels)
|
|
|
|
}
|
|
|
|
|
|
|
|
function editPermission(key, holdings, permissionType, channels, isPrivate) {
|
|
|
|
d.createOrEdit(key, holdings, permissionType, isPrivate, channels)
|
|
|
|
}
|
|
|
|
|
|
|
|
function removePermission(key) {
|
|
|
|
root.chatCommunitySectionModuleInst.deleteCommunityTokenPermission(
|
|
|
|
root.activeSectionId, key)
|
|
|
|
}
|
|
|
|
}
|