openwisp / openwisp/openwisp-controller
[feature] Show shared objects for org-wide batch commands as read-only to non-superusers
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 773
- Forks
- 315
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 14
Description
Is your feature request related to a problem? Please describe.
Org-wide batch commands (organization=null) created by superusers are currently visible to all organization managers/admins via the REST API. However, there is no proper support in openwisp-users for showing shared objects as read-only to non-superusers. This means org admins can see batch commands they didn't create and shouldn't have full access to.
Describe the solution you'd like
- Implement shared object read-only support in openwisp-users so non-superusers can see objects with organization=null but cannot modify them.
- Once https://github.com/openwisp/openwisp-users/pull/444 merged, remove the temporary queryset filter in BatchCommandListView and BatchCommandDetailView that excludes organization=null for non-superusers.
- Ensure org-wide batch commands are visible as read-only to org managers, while keeping create/update/delete restricted to superusers.
- Hide sensitive data such as primary keys, error logs, and other restricted information from non-superusers for objects not in their managed organizations.
Describe alternatives you've considered
PR https://github.com/openwisp/openwisp-controller/pull/1395 implements the Mass Command model and REST APIs with a temporary queryset filter (with TODO comments) to exclude organization=null commands for non-superusers. This workaround will be removed once openwisp-users properly supports shared objects as read-only.
Additional context
-
Related openwisp-users issues and PR:
https://github.com/openwisp/openwisp-users/issues/238
https://github.com/openwisp/openwisp-users/issues/448
https://github.com/openwisp/openwisp-users/pull/444 -
Releted openwisp-controller batch command issues and PR:
https://github.com/openwisp/openwisp-controller/issues/1344
https://github.com/openwisp/openwisp-controller/issues/1345
https://github.com/openwisp/openwisp-controller/pull/1395
https://github.com/openwisp/openwisp-controller/pull/1420
Note: Do not pick this up until the related issues/PR are closed.
Contributor guide
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.
Research direction
Wait for the related openwisp-users work, especially PR #444, before starting. Then inspect BatchCommandListView and BatchCommandDetailView in openwisp-controller, including the temporary queryset filters and TODOs introduced around PR #1395. Done means organization=null batch commands are visible read-only to non-superusers, mutations remain restricted, and sensitive fields are hidden.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- api, authorization, backend, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100