Documentation
¶
Overview ¶
Package resourcelevel narrows a caller's resource claims to their persona's portal resources level (#2225).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(ctx context.Context, claims *resource.Claims, pr *persona.Registry, method string) (*resource.Claims, error)
Apply narrows a caller's resource claims to their persona's portal resources level (#2225): none refuses every resources route, shared reads the caller's own folder, their persona's folder and Global and writes nothing, own drops the persona folders and keeps the caller's own (which an administrator still sees), and persona leaves the claims as they were. An administrator is held to none of it.
A person of an external persona reads only their own folder, never Global or their persona's (#2257, #2290), and writes to it only when the persona lets its people upload (#2258). What is shared with them they read through their shares.
The claims carry the caller's write grants on Global folders (#2684), read once for the request; the level above is the ceiling no grant overrides.
Types ¶
type RefusedError ¶ added in v1.166.3
type RefusedError struct {
// contains filtered or unexported fields
}
RefusedError is a refusal for what the caller's persona allows: the resource handler answers it 403 with its words, and it is a resource.ErrForbidden.
func (*RefusedError) Error ¶ added in v1.166.3
func (e *RefusedError) Error() string
func (*RefusedError) Is ¶ added in v1.166.3
func (*RefusedError) Is(target error) bool
Is makes every RefusedError a resource.ErrForbidden.
func (*RefusedError) Refusal ¶ added in v1.166.3
func (e *RefusedError) Refusal() string
Refusal is what the caller is told.