AACEngineering / django-permissions-auditor

Tool to audit access control on your django app.
https://django-permissions-auditor.readthedocs.io/en/latest/
MIT License
20 stars 4 forks source link

Basic support for django rest framework #12

Closed jeffgabhart closed 2 years ago

jeffgabhart commented 2 years ago

Check cls for django rest framework viewsets. This was enough for me to pull basic docstring information from the class.

codecov[bot] commented 2 years ago

Codecov Report

Merging #12 (10edece) into master (fc7f939) will increase coverage by 0.02%. The diff coverage is 100.00%.

:exclamation: Current head 10edece differs from pull request most recent head bac834d. Consider uploading reports for the commit bac834d to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##           master      #12      +/-   ##
==========================================
+ Coverage   92.26%   92.28%   +0.02%     
==========================================
  Files           8        8              
  Lines         349      350       +1     
  Branches       81      101      +20     
==========================================
+ Hits          322      323       +1     
  Misses          8        8              
  Partials       19       19              
Impacted Files Coverage Δ
permissions_auditor/core.py 91.89% <100.00%> (+0.11%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update fc7f939...bac834d. Read the comment docs.

kluchrj commented 2 years ago

Thanks. I squashed the commit.

jeffgabhart commented 2 years ago

@kluchrj I think this breaks non-CBV's and should be reverted.

kluchrj commented 2 years ago

Non-CBVs seem to be working fine for me, and the tests are passing. Is there an issue you are encountering with the newer version?

From what I understand, the change shouldn't have any effect if the view doesn't define cls. Django's CBVs don't define that as far as I can tell.

jeffgabhart commented 2 years ago

ok, thanks, maybe it's something I messed up as I try to get DRF @action identified for custom permission classes. Sorry to bother.