angee.base.actors
REBAC actor projection helpers for model code.
ACTOR_USER_RESOLVERS_SETTING
Settings key mapping non-user REBAC subject types to user-id resolver callables.
is_user_actor
def is_user_actor(actor: Any) -> boolReturn whether actor is an authorization-layer user subject.
This is the species check for authorizing user-only operations. It is distinct from attribution resolution, where non-user actors may map to a service user FK through :func:actor_user_id.
actor_user_id
def actor_user_id(actor: Any) -> Any | NoneReturn actor's user primary key, or None when no user backs it.
The one reading of "this REBAC actor, as a user foreign-key id" — the value that backs user-owned columns (created_by / updated_by / trashed_by …). The REBAC subject id may be a public id such as sqid; FK columns need the database primary key. Non-user subject types can opt in through :setting:ANGEE_ACTOR_USER_RESOLVERS; absent mappings fail safe to None.