agency.security

Functions

get_current_role(→ str | None)

Returns the current role of the identity. Elevates the role from member

has_permission(→ bool)

Global permission with elevated roles.

has_model_permission(→ bool)

Specific model permission with elevated roles for this model.

has_permission_all(→ bool)

has_permission_agency(→ bool)

has_permission_agency_membership(→ bool)

has_permission_person(→ bool)

has_permission_agency_collection(→ bool)

has_permission_agency_move(→ bool)

has_permission_agency_membership_move_within_agency(→ bool)

has_permission_agency_membership_move_within_person(→ bool)

has_permission_agency_mutation_ticket(→ bool)

has_permission_person_mutation_ticket(→ bool)

Module Contents

agency.security.get_current_role(session: sqlalchemy.orm.Session, identity: Identity | NoIdentity) str | None[source]

Returns the current role of the identity. Elevates the role from member to editor if any group role mapping with editor role is present.

agency.security.has_permission(app: onegov.agency.AgencyApp, identity: morepath.authentication.Identity, model: object, permission: object) bool[source]

Global permission with elevated roles.

agency.security.has_model_permission(app: onegov.agency.AgencyApp, identity: morepath.authentication.Identity, model: object, permission: object) bool[source]

Specific model permission with elevated roles for this model.

agency.security.has_permission_all(app: onegov.agency.AgencyApp, identity: morepath.authentication.Identity, model: object, permission: object) bool[source]
agency.security.has_permission_agency(app: onegov.agency.AgencyApp, identity: morepath.authentication.Identity, model: onegov.people.Agency, permission: object) bool[source]
agency.security.has_permission_agency_membership(app: onegov.agency.AgencyApp, identity: morepath.authentication.Identity, model: onegov.people.AgencyMembership, permission: object) bool[source]
agency.security.has_permission_person(app: onegov.agency.AgencyApp, identity: morepath.authentication.Identity, model: onegov.people.Person, permission: object) bool[source]
agency.security.has_permission_agency_collection(app: onegov.agency.AgencyApp, identity: morepath.authentication.Identity, model: onegov.people.AgencyCollection, permission: object) bool[source]
agency.security.has_permission_agency_move(app: onegov.agency.AgencyApp, identity: morepath.authentication.Identity, model: onegov.agency.models.AgencyMove, permission: object) bool[source]
agency.security.has_permission_agency_membership_move_within_agency(app: onegov.agency.AgencyApp, identity: morepath.authentication.Identity, model: onegov.agency.models.AgencyMembershipMoveWithinAgency, permission: object) bool[source]
agency.security.has_permission_agency_membership_move_within_person(app: onegov.agency.AgencyApp, identity: morepath.authentication.Identity, model: onegov.agency.models.AgencyMembershipMoveWithinPerson, permission: object) bool[source]
agency.security.has_permission_agency_mutation_ticket(app: onegov.agency.AgencyApp, identity: morepath.authentication.Identity, model: onegov.agency.models.ticket.AgencyMutationTicket, permission: object) bool[source]
agency.security.has_permission_person_mutation_ticket(app: onegov.agency.AgencyApp, identity: morepath.authentication.Identity, model: onegov.agency.models.ticket.PersonMutationTicket, permission: object) bool[source]