[Bug] Daily cron jobs silently reset all role permissions, discarding admin changes
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- django, python
- Domain
- authorization, backend
Research direction
Start by locating CRON_CLASSES, task_sync_global_permissions, task_sync_role_permissions_to_default, and task_sync_role_permissions, then read the permission model documentation mentioned in the issue. Compare the scheduled syncs with the Admin Tasks actions and determine which policy the project should adopt: opt-in syncing, documenting locked defaults, or supporting local extensions. Done means the chosen policy prevents unexpected permission loss and is reflected in behavior or documentation, with removals logged if appropriate.
Written by the indexing model from the issue text.
Description
Summary
CRON_CLASSES runs three permission tasks every day at 07:30:
task_sync_global_permissions: for everyGlobal: *group,sync_global_permissions()callsself.permissions.clear(), then re-adds only whatGlobalRoles.PERMISSIONSlists.task_sync_role_permissions_to_default: for every default unit role,sync_default_permissions()callsself.permissions.clear(), then re-addsUnitRolesdefaults.task_sync_role_permissions: re-syncs unit members' guardian permissions from their roles.
The same actions are also on the Administration → Admin Tasks menu for staff users.
Impact
- Changes don't last: anything an administrator changes on a global group or a default unit role (in Django admin or the shell) is silently undone at 07:30 the next morning.
- Workarounds for missing permissions fail: for example, adding awarding-body permissions to
Global: Adminlasts less than a day. - Nothing warns about it: there's no log entry, no activity record and no note in the docs. The "Permission Model" docs say the matrix views "surface any drift", but drift is erased daily.
Suggested fix
Any of these:
- Make it opt-in: keep the code definitions as the single source of truth, but only resync on deploy (
post_migrate) or on demand, not daily. - Document it: say that global and default-role permissions can't be customised and changes are overwritten, and stop admins editing those groups in the Django admin.
- Support local changes: add a setting such as
GLOBAL_ROLE_EXTRA_PERMISSIONS = {"Admin": ["jobtracker.add_awardingbody", ...]}that the sync merges in, so sites can extend roles without forking.
Whichever is chosen, it would help to log each permission the sync removes.
- Dominant language
- HTML
- Stars
- 6
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from brainthee/CHAOTICA
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
[Minor UI Bug] Client page shows account manager photos as squares overlapping the round borderOpen
Difficulty 1/5 Under an hour Newbie friendliness 94/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
All issues in brainthee/CHAOTICA
Similar issues
-
Codex使用可 コード
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ryuki-moro/Nicomaru#218 ·
Maintainers usually reply within 3 days
-
bug good first issue priority: P2 status: ready
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
RhinoLink-Tech/data-fabric#499 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
btclib-org/btclib-wallet#801 · 1 comment ·
Maintainers usually reply within 1 day
-
ledger
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Semi-Professional-Organization/pet-shelter#299 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
kinqsradio/orbyn-engineering#471 ·