mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-27 03:54:57 +02:00
Readonly forbid GitHub authorization (#9212)
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user