-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add show_permissions management command #1920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add show_permissions management command #1920
Conversation
Could you take a look at the Django 4.2 tests please ? |
Create a separate section for each field, making it easier to share a link to a specific part
* Use .python_history for shell_plus command * Update shell_plus.py * Update shell_plus.py --------- Co-authored-by: igorgaming <[email protected]>
I'll take a look at the Django 4.2 test failures and investigate what's going wrong. Will update the PR shortly. 🙌 |
…a `field-type-differ` (django-extensions#1867) `` lead to fictive differences when comparing AutoField to integer ``` $ python manage.py sqldiff -a -t + Application: admin |-+ Differences for model: LogEntry |--+ field 'id' not of same type: db='serial', model='integer' ```
…xtensions#1887) This fixes an error with runjobs when a jobs.py exists in the environment. Modules have no `__path__` member defined unless it's a package so we should be able to rely on that here.
we are in the process of moving away from setup.py/setup.cfg but for now add these lines here as well to satisfy pipelines
One last ask :-) could you add a page to the documentation for Thanks ! |
List of backends provided by django-prometheus: https://github.com/korfuri/django-prometheus/tree/master/django_prometheus/db/backends This will fix the issue of not being able to reset_db as the backend is unknown. A workaround I was using in `settings.py` it the following: ```python if 'reset_db' not in sys.argv: DATABASES['default']['ENGINE'] = DATABASES['default']['ENGINE'].replace( 'django.db.backends', 'django_prometheus.db.backends' ) ``` Co-authored-by: trbs <[email protected]>
Running `hatch new --init`
I hope everything goes well now . |
Hi @trbs , |
Think something went wrong in rebasing the PR... |
there was a conflict but the was with only my two file show_permissions.py and test_show_permissions.py. and this 308 changes were happening from whenever i was running the tox in my machine even before the rebasing |
It might be easier to redo this PR... If you want I can merge the changes in directly as well and give you attribution (but we will lose your commits from the branch) |
I merged it with the correct author commit as well 👍 Thanks @PravinKamble123 for all your hard work on this ! |
i'm sorry for the mess. I will be more careful in future |
No worries ! |
hi @trbs , |
Yeah please submit another PR 👍 Btw you on the list in git :-)
![]() |
this is only way i can contact you @trbs . |
Synchronising forks from the command line can be a bit tricky, I would recommend doing it from the GitHub UI which is less error prone:
|
Wowwww Thank you so much for such detail help. |
Hi @browniebroke, |
(Please consider I have zero experience with windows, so what I say might not be accurate) Seems that something went wrong with your git repository / the checked out files, it looks like (windows ?) has marked a lot of files as executable this is not allowed. What I would suggest is to remove this fork (on your local filesystem and probably also in github) and fork it again. Such that you know for sure your starting from a clean and correct fork. If it happens again than at least you know that you started from a clean setup and have a way to reproduce the problem reliably to try and find out where things go wrong. (Hopefully somebody / stackoverflow can help...) And latestly if possible for you I would suggest to look into using a Linux (like Debian or Ubuntu) Virtual Machine or WSL, such that you have a more Unix/Linux/Mac like environment which, at least from my perspective, is much easier for any development. |
on windows from scratch.
Fixing tests/testapp/templates/hello_world.html mixed line ending........................................................Failed
tests/test_templatetag on ubuntu from scratch |
so it is confirmed on windows it causing the issue. On Windows, Git doesn't handle Unix-style executable bits and line endings the same way.
These issues don’t appear on Unix-based systems, which is why the hooks pass there but not on Windows. |
i will use ubuntu from now onwards |
Summary
This PR adds a new management command
show_permissions
that allows developers to list model-level permissions in their project.It supports:
auth.user
)--all
flag to include default Django apps likeauth
,admin
, etc.Motivation
This is based on an idea and implementation shared by @Kagee . Many thanks to him for the logic and inspiration behind this feature.
Related Issue
Fixes #1916
Labels
This PR falls under:
feature request
need patch