Sanity Library Reference Docs
Preparing search index...
@sanity/workflow-engine
define
defineGuard
Function defineGuard
defineGuard
(
guard
:
{
description
?:
string
;
match
:
{
actions
:
(
"create"
|
"update"
|
"delete"
|
"publish"
|
"unpublish"
)
[]
;
idPatterns
?:
string
[]
;
idRefs
?:
GuardRead
[]
;
types
?:
string
[]
;
}
;
metadata
?:
{
[
key
:
string
]:
GuardRead
}
;
name
:
string
;
predicate
?:
string
;
title
?:
string
;
}
,
)
:
{
description
?:
string
;
match
:
{
actions
:
(
"create"
|
"update"
|
"delete"
|
"publish"
|
"unpublish"
)
[]
;
idPatterns
?:
string
[]
;
idRefs
?:
GuardRead
[]
;
types
?:
string
[]
;
}
;
metadata
?:
{
[
key
:
string
]:
GuardRead
}
;
name
:
string
;
predicate
?:
string
;
title
?:
string
;
}
Parameters
guard
:
{
description
?:
string
;
match
:
{
actions
:
(
"create"
|
"update"
|
"delete"
|
"publish"
|
"unpublish"
)
[]
;
idPatterns
?:
string
[]
;
idRefs
?:
GuardRead
[]
;
types
?:
string
[]
;
}
;
metadata
?:
{
[
key
:
string
]:
GuardRead
}
;
name
:
string
;
predicate
?:
string
;
title
?:
string
;
}
Returns
{
description
?:
string
;
match
:
{
actions
:
(
"create"
|
"update"
|
"delete"
|
"publish"
|
"unpublish"
)
[]
;
idPatterns
?:
string
[]
;
idRefs
?:
GuardRead
[]
;
types
?:
string
[]
;
}
;
metadata
?:
{
[
key
:
string
]:
GuardRead
}
;
name
:
string
;
predicate
?:
string
;
title
?:
string
;
}
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
Sanity Library Reference Docs
Loading...