Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ordering actions still rendered in action dropdown even if user don't have change permission. #400

Open
girase1pranay opened this issue Jul 24, 2024 · 6 comments
Labels

Comments

@girase1pranay
Copy link

Python: 3.11
Django: 5.0.4

In admin change list, ordering actions [ move_to_exact_page, move_to_back_page, move_to_last_page, move_to_first_page, move_to_forward_page] still rendered in action dropdown even if user don't have change permission.

How can we remove those actions from dropdown on the basis of permission?

@jrief jrief added the bug label Jul 24, 2024
@jrief
Copy link
Owner

jrief commented Jul 24, 2024

Fair point. I have to fix that.

@drowsyzen
Copy link

Hi Jrief,

I’d like to take this issue. If you could assign it to me, that would be helpful. I have read the Contributor's Guide and will follow it.

@girase1pranay
Copy link
Author

@jrief, By when can we expect the new release?

@jrief
Copy link
Owner

jrief commented Aug 12, 2024

@drowsyzen you can come up with a pull request. I then will review it.

@drowsyzen
Copy link

@jrief i am working on the solution and will open pull request soon(by tomorrow). I have one query.

There are four permissions for model in admin (add, change, delete, view).

For which of these the dropdown should come and for which should it not?

Currently I am making it so that users with view permission will not see the dropdowns.
And users with either on of the rest three will see the dropdowns.

@jrief
Copy link
Owner

jrief commented Aug 14, 2024

In my opinion the change_<my_model> permission would be appropriate. An alternative would be to add a custom permission to the model's Meta-class, say [("reorder", "Can reorder items")] as described here: https://docs.djangoproject.com/en/5.1/ref/models/options/#permissions and use the change-permission as fallback.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants