Page MenuHomePhabricator

Remove `is_staff` checks from Tracker
Open, LowPublic

Description

Problem

Tracker contains some user.is_staff checks, which can expose some information even to admins with no permission to see it. Example of this is in viewsets.py. or importcsv/export in views.py. This is problematic because user who is a staff can have zero permissions assigned, and thus, actually have no advanced permissions.

Proposed solution

Please fix one occurance of this bug. You should use your own judgement if a new permission would be appropriate, or if one of Django default permissions can be reused.

Student is expected to send a patch for wikimedia-cz/tracker repository, hosted at Wikimedia Gerrit. When claiming task on GCI website, student should claim a respective Phabricator task as well.

Materials

Event Timeline

Thank you, Gopa, but, in the future, I'd like to import my own tasks myself.. Thanks!

Hi,

it might relate to my missing knowledge of the codebase, however, GCI students will not have any context as well, so: Can you give a bit more context of the problem? Why is an "is_staff" check problematic and what is the expected replacement? Checking for a specific permission? Adding a new one or re-using an existing one? Once this is clarified, I would be happy to publish this task on the GCI website :)

Awesome, thanks @Urbanecm :) I published the task!

Change #1178712 had a related patch set uploaded (by Vanshika11; author: Vanshika11):

[wikimedia-cz/tracker@master] T237160: Replace is_staff check with proper permission check

https://gerrit.wikimedia.org/r/1178712

Change #1178713 had a related patch set uploaded (by Vanshika11; author: Vanshika11):

[wikimedia-cz/tracker@master] T237160: Replace is_staff check with proper permission check

https://gerrit.wikimedia.org/r/1178713

Change #1178714 had a related patch set uploaded (by Vanshika11; author: Vanshika11):

[wikimedia-cz/tracker@master] T237160: Replace is_staff check with proper permission check

https://gerrit.wikimedia.org/r/1178714

Change #1178712 abandoned by Vanshika11:

[wikimedia-cz/tracker@master] T237160: Replace is_staff check with proper permission check

Reason:

duplicate

https://gerrit.wikimedia.org/r/1178712

Change #1178713 abandoned by Vanshika11:

[wikimedia-cz/tracker@master] T237160: Replace is_staff check with proper permission check

Reason:

duplicate

https://gerrit.wikimedia.org/r/1178713

Change #1179020 had a related patch set uploaded (by Vanshika11; author: Vanshika11):

[wikimedia-cz/tracker@master] T237160: Fix bug where renaming a document changes the uploader

https://gerrit.wikimedia.org/r/1179020

Change #1178713 restored by Vanshika11:

[wikimedia-cz/tracker@master] T237160: Replace is_staff check with proper permission check

https://gerrit.wikimedia.org/r/1178713

Change #1179020 had a related patch set uploaded (by Vanshika11; author: Vanshika11):

[wikimedia-cz/tracker@master] T237160: Fix bug where renaming a document changes the uploader

https://gerrit.wikimedia.org/r/1179020

Change #1178713 had a related patch set uploaded (by Vanshika11; author: Vanshika11):

[wikimedia-cz/tracker@master] T237160: Replace is_staff check with proper permission check

https://gerrit.wikimedia.org/r/1178713

Change #1178714 abandoned by Vanshika11:

[wikimedia-cz/tracker@master] T237160: Replace is_staff check with proper permission check The Problem is that currently, the code uses `is_staff` to check if a user can perform certain actions. This is not precise and may grant permissions to users who shouldn't have them.

Reason:

dupliacte

https://gerrit.wikimedia.org/r/1178714

Hi! I’m a newcomer and would like to work on this task as my first contribution. Could I please be assigned?