Skip to content

Conversation

@cyrillkuettel
Copy link
Contributor

@cyrillkuettel cyrillkuettel commented Sep 17, 2025

Please fill in the commit message below and work through the checklist. You can delete parts that are not needed, e.g. the optional description, the link to a ticket or irrelevant options of the checklist.

Commit message

Pas: Extends permission system

In some ways this is similar to 4f8e72c.

TYPE: Feature
LINK: OGC-2573

Checklist

  • I have performed a self-review of my code

@linear
Copy link

linear bot commented Sep 17, 2025

@codecov
Copy link

codecov bot commented Sep 17, 2025

Codecov Report

❌ Patch coverage is 83.47339% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.55%. Comparing base (392e167) to head (106a157).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/onegov/pas/security.py 84.04% 15 Missing ⚠️
src/onegov/pas/cli.py 33.33% 12 Missing ⚠️
src/onegov/pas/collections/parliamentarian.py 83.60% 10 Missing ⚠️
src/onegov/pas/collections/attendence.py 57.89% 8 Missing ⚠️
src/onegov/pas/utils.py 58.82% 7 Missing ⚠️
src/onegov/pas/forms/attendence.py 92.68% 3 Missing ⚠️
src/onegov/pas/forms/user.py 71.42% 2 Missing ⚠️
src/onegov/pas/homepage.py 91.66% 1 Missing ⚠️
src/onegov/pas/views/settlement_run.py 0.00% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/onegov/pas/__init__.py 100.00% <ø> (ø)
src/onegov/pas/app.py 100.00% <100.00%> (ø)
src/onegov/pas/cronjobs.py 33.33% <100.00%> (ø)
src/onegov/pas/custom.py 93.61% <100.00%> (+1.72%) ⬆️
src/onegov/pas/export_single_parliamentarian.py 41.89% <100.00%> (+0.79%) ⬆️
src/onegov/pas/forms/parliamentarian.py 100.00% <100.00%> (ø)
src/onegov/pas/importer/orchestrator.py 11.23% <ø> (ø)
src/onegov/pas/layouts/attendence.py 97.72% <100.00%> (+2.48%) ⬆️
src/onegov/pas/layouts/default.py 100.00% <100.00%> (ø)
src/onegov/pas/layouts/import_layout.py 100.00% <ø> (ø)
... and 20 more

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 392e167...106a157. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

cyrillkuettel and others added 20 commits September 18, 2025 15:47
TYPE: Bugfix
LINK: OGC-2512
- Add helper functions for parliamentarian/user creation
- Add attendance creation helpers
- Add commission setup helpers
- Reduce test code duplication by ~26% (280→205 lines)
- Fix line length violations in test files
- Add Private permission override for parliamentarian and
  commission_president roles
- Fix attendance collection and individual attendance access permissions
- Parliamentarians can now view /attendence/{id} and /attendences routes
- Maintains security by only granting Private access for attendance models
- Add ownership-based access control for attendance records
- Allow parliamentarians to access only their own attendance data
- Allow commission presidents to access their own + members' data
- Add file collection access permissions for parliamentarians
- Add German translation for JSON schema validation message
- Move datetime import to module level in security.py
- Remove unused GeneralFileCollection permission rule
- Fix attendance view to properly filter records for parliamentarians
- Ensure bulk edit grouping works with filtered results
1. Form Validation: Added validate_parliamentarian_id() method to AttendenceAddForm that:
    - Ensures parliamentarians can only add attendance for themselves
    - Allows commission presidents to add for their commission members
    - Prevents unauthorized access attempts
2. Dropdown Restrictions: Modified on_request() method to:
    - Show only the parliamentarian's own entry for regular parliamentarians
    - Show self + commission members for commission presidents
    - Show all parliamentarians for admins/editors (existing behavior)
@cyrillkuettel cyrillkuettel force-pushed the ogc-2573-berechtigungssystem-parlamentarier branch from 2d395bd to 13c7224 Compare September 23, 2025 14:20
@cyrillkuettel cyrillkuettel merged commit da76354 into master Sep 24, 2025
@cyrillkuettel cyrillkuettel deleted the ogc-2573-berechtigungssystem-parlamentarier branch September 24, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants