enum

PythonGuardDefinitions::ViewAccess

Inherits Enum < Comparable < Value < Object

How wrapper def name in file lets a caller who is not identified reach the view, judged by the conditions above each view call: the enclosing if / elif / else branches and the earlier sibling ifs that refuse. CTFd's require_verified_emails calls the view whenever email verification is off and never asks who the caller is, so it is not a guard. check_score_visibility calls it when the visibility setting is public and otherwise only for a logged-in caller or an admin: a guard that a setting can lift. A view call under no condition is not judged (the refusal may sit in a helper it calls), and a condition on the decorator's own parameters is the call site's choice (admission(roles=...)), not the caller's.

Constants

Closed = 0

Every judged path to the view needs an identified caller.

Setting = 1

A path needs none, on conditions that do not read the caller, and no other path needs one.

Configurable = 2

A setting opens a path; every other judged path needs an identified caller.

Caller = 3

A path needs none although its conditions read the caller.

Instance methods

caller?

Returns true if this enum value equals Caller

Source
closed?

Returns true if this enum value equals Closed

Source
configurable?

Returns true if this enum value equals Configurable

Source
setting?

Returns true if this enum value equals Setting

Source