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
+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 (