Update SDK to account for new creator builder flag
This commit is contained in:
parent
778104d6e6
commit
9b99991b2e
|
@ -87,13 +87,21 @@ export function hasAdminPermissions(user?: User | ContextUser): boolean {
|
|||
return !!user.admin?.global
|
||||
}
|
||||
|
||||
export function hasCreatorPermissions(user?: User | ContextUser): boolean {
|
||||
if (!user) {
|
||||
return false
|
||||
}
|
||||
return !!user.builder?.creator
|
||||
}
|
||||
|
||||
export function isCreator(user?: User | ContextUser): boolean {
|
||||
if (!user) {
|
||||
return false
|
||||
}
|
||||
return (
|
||||
isGlobalBuilder(user) ||
|
||||
isGlobalBuilder(user!) ||
|
||||
hasAdminPermissions(user) ||
|
||||
hasCreatorPermissions(user) ||
|
||||
hasAppBuilderPermissions(user) ||
|
||||
hasAppCreatorPermissions(user)
|
||||
)
|
||||
|
|
|
@ -44,6 +44,7 @@ export interface User extends Document {
|
|||
builder?: {
|
||||
global?: boolean
|
||||
apps?: string[]
|
||||
creator?: boolean
|
||||
}
|
||||
admin?: {
|
||||
global: boolean
|
||||
|
|
Loading…
Reference in New Issue