EZQMS-729: Restrict spaces operations (#5500)

This commit is contained in:
Alexey Zinoviev
2024-05-04 20:49:24 +07:00
committed by GitHub
parent ad59463057
commit 4bc1534ee0
57 changed files with 873 additions and 114 deletions
+5 -2
View File
@@ -128,7 +128,8 @@ export default plugin(settingId, {
Owners: '' as Ref<Doc>,
InviteSettings: '' as Ref<Doc>,
WorkspaceSetting: '' as Ref<Doc>,
ManageSpaces: '' as Ref<Doc>
ManageSpaces: '' as Ref<Doc>,
Spaces: '' as Ref<Doc>
},
mixin: {
Editable: '' as Ref<Mixin<Editable>>,
@@ -169,6 +170,7 @@ export default plugin(settingId, {
string: {
Settings: '' as IntlString,
Setting: '' as IntlString,
Spaces: '' as IntlString,
WorkspaceSettings: '' as IntlString,
Branding: '' as IntlString,
Integrations: '' as IntlString,
@@ -219,7 +221,8 @@ export default plugin(settingId, {
Clazz: '' as Asset,
Enums: '' as Asset,
InviteSettings: '' as Asset,
InviteWorkspace: '' as Asset
InviteWorkspace: '' as Asset,
Views: '' as Asset
},
templateFieldCategory: {
Integration: '' as Ref<TemplateFieldCategory>
+9 -6
View File
@@ -25,7 +25,8 @@ import core, {
Space,
SpaceType,
TxOperations,
TypeAny as TypeAnyType
TypeAny as TypeAnyType,
getRoleAttributeBaseProps
} from '@hcengineering/core'
import { TypeAny } from '@hcengineering/model'
import { getEmbeddedLabel, IntlString } from '@hcengineering/platform'
@@ -74,12 +75,14 @@ export interface RoleAttributeProps {
}
export function getRoleAttributeProps (data: AttachedData<Role>, roleId: Ref<Role>): RoleAttributeProps {
const name = data.name.trim()
const label = getEmbeddedLabel(`Role: ${name}`)
const roleType = TypeAny(setting.component.RoleAssignmentEditor, label, setting.component.RoleAssignmentEditor)
const id = `role-${roleId}` as Ref<Attribute<PropertyType>>
const baseProps = getRoleAttributeBaseProps(data, roleId)
const roleType = TypeAny(
setting.component.RoleAssignmentEditor,
baseProps.label,
setting.component.RoleAssignmentEditor
)
return { label, roleType, id }
return { ...baseProps, roleType }
}
export async function createSpaceTypeRole (