mirror of
https://github.com/saltbo/zpan.git
synced 2026-09-24 23:22:31 +08:00
feat: attribute files and downloads to actors (#559)
* feat: attribute files and downloads to actors * chore: refresh preview after staging migration * fix: use a dash for missing actor identity * fix: complete actor attribution and file creator UI * fix: refine file creator identity UI
This commit is contained in:
@@ -5,7 +5,7 @@ import type { DavLock } from '../domain/webdav'
|
||||
import type { WebDavMountPath } from '../domain/webdav-public-url'
|
||||
import type { Platform } from '../platform/interface'
|
||||
import type { Deps } from '../usecases/deps'
|
||||
import type { WebDavTarget } from '../usecases/ports'
|
||||
import type { ActorIdentity, WebDavTarget } from '../usecases/ports'
|
||||
import type { TransferAuditTarget } from '../usecases/transfer-activity'
|
||||
|
||||
export type Env = {
|
||||
@@ -157,6 +157,15 @@ export function boundWorkspaceOrgId(context: AuthzContext): string | null {
|
||||
return context.workspace.mode === 'bound' ? context.workspace.orgId : null
|
||||
}
|
||||
|
||||
export function authzActorIdentity(context: AuthzContext): ActorIdentity | null {
|
||||
if (!context.actor) return null
|
||||
return {
|
||||
type: context.actor.type,
|
||||
ref: context.actor.ref,
|
||||
issuer: 'issuer' in context.actor ? context.actor.issuer : null,
|
||||
}
|
||||
}
|
||||
|
||||
export const anonymousAuthzContext = (): AuthzContext => ({
|
||||
credential: 'anonymous',
|
||||
userId: null,
|
||||
|
||||
Reference in New Issue
Block a user