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
|
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 {
|
export function isCreator(user?: User | ContextUser): boolean {
|
||||||
if (!user) {
|
if (!user) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
isGlobalBuilder(user) ||
|
isGlobalBuilder(user!) ||
|
||||||
hasAdminPermissions(user) ||
|
hasAdminPermissions(user) ||
|
||||||
|
hasCreatorPermissions(user) ||
|
||||||
hasAppBuilderPermissions(user) ||
|
hasAppBuilderPermissions(user) ||
|
||||||
hasAppCreatorPermissions(user)
|
hasAppCreatorPermissions(user)
|
||||||
)
|
)
|
||||||
|
|
|
@ -44,6 +44,7 @@ export interface User extends Document {
|
||||||
builder?: {
|
builder?: {
|
||||||
global?: boolean
|
global?: boolean
|
||||||
apps?: string[]
|
apps?: string[]
|
||||||
|
creator?: boolean
|
||||||
}
|
}
|
||||||
admin?: {
|
admin?: {
|
||||||
global: boolean
|
global: boolean
|
||||||
|
|
Loading…
Reference in New Issue