Readonly forbid GitHub authorization (#9212)

This commit is contained in:
Anton Alexeyev
2025-06-11 15:28:11 +07:00
committed by GitHub
parent f5f3a3d704
commit de3ed8d643
4 changed files with 19 additions and 5 deletions
@@ -3,10 +3,12 @@
import plugin from '../../plugin'
import { ComponentPointExtension } from '../../types'
import { getClient } from '../../utils'
import { getCurrentAccount, hasAccountRole } from '@hcengineering/core'
export let extension: ComponentExtensionId
export let props: Record<string, any> = {}
const currentAccount = getCurrentAccount()
let extensions: ComponentPointExtension[] = []
void getClient()
@@ -14,7 +16,7 @@
extension
})
.then((res) => {
extensions = res
extensions = res.filter((it) => it.accessLevel === undefined || hasAccountRole(currentAccount, it.accessLevel))
})
</script>
+3 -1
View File
@@ -11,7 +11,8 @@ import {
type RelatedDocument,
type Space,
type TxOperations,
type BlobMetadata
type BlobMetadata,
type AccountRole
} from '@hcengineering/core'
import { type Asset, type IntlString, type Resource } from '@hcengineering/platform'
import { type AnyComponent, type AnySvelteComponent, type ComponentExtensionId } from '@hcengineering/ui/src/types'
@@ -92,6 +93,7 @@ export interface ComponentExt {
export interface ComponentPointExtension extends Doc, ComponentExt {
// Extension point we should extend.
extension: ComponentExtensionId
accessLevel?: AccountRole
}
export type DocCreatePhase = 'pre' | 'post'