mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-06 01:14:52 +01:00
wip: zen
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Context } from "./context"
|
||||
import { UserRole } from "./schema/user.sql"
|
||||
import { Log } from "./util/log"
|
||||
|
||||
export namespace Actor {
|
||||
@@ -21,6 +22,7 @@ export namespace Actor {
|
||||
userID: string
|
||||
workspaceID: string
|
||||
accountID: string
|
||||
role: (typeof UserRole)[number]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,4 +82,12 @@ export namespace Actor {
|
||||
}
|
||||
throw new Error(`actor of type "${actor.type}" is not associated with an account`)
|
||||
}
|
||||
|
||||
export function userID() {
|
||||
return Actor.assert("user").properties.userID
|
||||
}
|
||||
|
||||
export function userRole() {
|
||||
return Actor.assert("user").properties.role
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user