rule
rule<
R>(fn):Rule<R>
Defined in: packages/schema/src/access/rule.ts:26
Wraps an access function so it combines with others through .and() and .or(); roles.can() and roles.is()
return such rules already.
Type Parameters
Section titled “Type Parameters”R = any
Parameters
Section titled “Parameters”AccessFn<R>
Returns
Section titled “Returns”Rule<R>
Example
Section titled “Example”const notShipped = rule((ctx, order) => order?.status !== 'shipped')resource('orders').access({ update: notShipped.and(roles.can('orders.update')) })