pas.security

Functions

get_roles_setting(→ dict[str, ...)

has_permission_logged_in(→ bool)

restrict_attendence_collection_access(→ bool)

restrict_attendence_access(→ bool)

restrict_parliamentarian_access(→ bool)

restrict_organisation_access(→ bool)

restrict_files_collection_access(→ bool)

Grant parliamentarians and commission presidents access to files

has_private_access_to_commission(→ bool)

-Looks up the User from database by username

Module Contents

pas.security.get_roles_setting() dict[str, set[type[onegov.core.security.roles.Intent]]][source]
pas.security.has_permission_logged_in(app: onegov.pas.PasApp, identity: morepath.Identity, model: Any, permission: onegov.core.security.roles.Intent) bool[source]
pas.security.restrict_attendence_collection_access(app: onegov.pas.PasApp, identity: morepath.Identity, model: onegov.pas.collections.AttendenceCollection, permission: onegov.core.security.roles.Intent) bool[source]
pas.security.restrict_attendence_access(app: onegov.pas.PasApp, identity: morepath.Identity, model: onegov.pas.models.attendence.Attendence, permission: onegov.core.security.roles.Intent) bool[source]
pas.security.restrict_parliamentarian_access(app: onegov.pas.PasApp, identity: morepath.Identity, model: onegov.pas.models.parliamentarian.PASParliamentarian, permission: onegov.core.security.roles.Intent) bool[source]
pas.security.restrict_organisation_access(app: onegov.pas.PasApp, identity: morepath.Identity, model: onegov.org.models.Organisation, permission: onegov.core.security.roles.Intent) bool[source]
pas.security.restrict_files_collection_access(app: onegov.pas.PasApp, identity: morepath.Identity, model: onegov.org.models.GeneralFileCollection, permission: onegov.core.security.roles.Intent) bool[source]

Grant parliamentarians and commission presidents access to files

pas.security.has_private_access_to_commission(app: onegov.pas.PasApp, identity: morepath.Identity, model: onegov.pas.models.commission.Commission, permission: onegov.core.security.roles.Intent) bool[source]

-Looks up the User from database by username - Verifies they’re actually a parliamentarian - Checks their commission memberships to see if they’re the - president of THIS specific commission If yes → grants access