@ @public
@public
Applies to: rpc
Section: §13.4
Syntax
Attr = "@" Path [ "(" [ AttrArgs ] ")" ] ;Grammar: App. A
Defined in
- 13.4 Authorisation and policies — The subject of a policy
- 4.9 Attributes — Syntax: @name or @name(arguments) before a declaration, field, parameter or rpc.
- 10.2 rpc attributes — Defaults for all rpcs are set in cluster { defaults { …
Examples
policy Orders {
allow get(id) if caller.isUser(db.find(Order, id)?.userId)
allow list, recent if caller.has(role: .Support)
allow * if caller.service("billing")
deny delete unless caller.has(role: .Admin) && caller is .User(mfa: true, ..)
}
@public rpc health() -> Ok
@allow(role: .Admin) rpc purge() -> Ok
@internal rpc create(…) -> Order— 13.4 Authorisation and policies
Related diagnostics
data-rights, missing-policy, unknown-policy-target, deprecated, attribute-not-applicable, cache-not-readonly, invalid-window, retry-not-idempotent, rpc-attr