Django Guardian | Object Level Permissions | Admin Site | Introduction | Part 2

Поделиться
HTML-код
  • Опубликовано: 8 ноя 2024

Комментарии • 29

  • @jonrowland04
    @jonrowland04 2 года назад +6

    As useal so well explained and extremely helpful! Thank you for these amazing lessons!

  • @jcobsky4852
    @jcobsky4852 2 года назад +1

    You're amazing man, thank you for such a great content you make!

  • @tluangadeveloper3067
    @tluangadeveloper3067 2 года назад +1

    shall i go for django or fastapi for inventory management system

    • @veryacademy
      @veryacademy  2 года назад

      Django if you like to have an admin site with little effort. If you go the Django path try Django ninja which is based on fastapi. It’s all about weighing up the pros and cons for your project.

  • @mma93067
    @mma93067 2 года назад +2

    This is was extremely helpful at getting me started with Django Guardian.
    However, how do we hide the object permissions button on the details page for the staff user? I find that the staff user is able to access the objection permissions page and change their own permissions for the given object which feels a bit silly

    • @ebrahimfawzy1916
      @ebrahimfawzy1916 Год назад

      same problem here.
      Staff user can simply modify his guardian permissions if he got module permission on the admin panel !
      That way, it is useless to make this effort.
      Any solution??

    • @GodwinMukoro
      @GodwinMukoro 11 месяцев назад

      Did anyone find answer to this question? Nice tutorial

  • @user-gf3hf5ri8b
    @user-gf3hf5ri8b Год назад +1

    In the previous tutorial we could also apply object level authorization:
    def has_change_permission(self, request, obj=None):
    # user can change those movies which are released today
    if obj:
    return obj.release_date == date.today() # will return True if obj.release date is today
    return False
    what's the use of Guardian object level ?

  • @phil_1234
    @phil_1234 2 года назад +1

    My question doesn´t fit into this video but I recently started with your ecommerce tutorial series. Could you make an additional video on how to upload multiple images per product from a form like amazon for example does. I checked stackoverflow and YT for that but so far there is no real video for that. Thank you so much for educating us.

    • @veryacademy
      @veryacademy  2 года назад +1

      Hi Phil so, to confirm. A single form on a django template whereby you can upload multiple images. I presume the images for the sake of the tutorial will just be stored in a media folder? Is this what you need?

    • @phil_1234
      @phil_1234 2 года назад

      @@veryacademy Yes exactly. Thanks for your answer

    • @veryacademy
      @veryacademy  2 года назад

      @@phil_1234 No problem - I will make a short tutorial today or tomorrow.

    • @phil_1234
      @phil_1234 2 года назад

      @@veryacademy Wow that would be very great. Thank you so much

    • @user-gf3hf5ri8b
      @user-gf3hf5ri8b Год назад

      Replying one year later lol. you could make a model specific for images so like ProductImages model which has image field and product id. all you have to do is create more and more images

  • @KrishnaManohar8021
    @KrishnaManohar8021 2 года назад +1

    Can you integrate to a frontend app, and restrict views?

    • @veryacademy
      @veryacademy  2 года назад +2

      Hi Manu, permissions on views is coming up next

    • @KrishnaManohar8021
      @KrishnaManohar8021 2 года назад +1

      @@veryacademy yaaaaa 🔥😘

  • @robertcoffie8789
    @robertcoffie8789 2 года назад +1

    Thanks

  • @matrixtoogood5601
    @matrixtoogood5601 2 года назад

    You have previously created REST Framework permissions and a few other permissions tutorials that were really helpful to begin with.
    (1) Are these object-level permissions complementary to those other types of permissions?
    (2) Are object-level permissions even required if we have view-level permissions?

    • @veryacademy
      @veryacademy  2 года назад +3

      Thank you, yes object level permissions compliment on from what we have looked at in the past. I only made the first tutorial for those who have yet seen or are familiar to permissions. Maybe I don’t fully understand your second question. Permissions are generally applied to groups or can be known as roles. We utilise these permissions to support decisions/logic/code in the views or other modules we might develop. Working at the object level we can further define permissions. Yes we can define rules or permissions in our views, using permissions creates a dynamic approach to allow working with the concept of grouping or roles that we might require in the application.

  • @twins_coder
    @twins_coder 2 года назад +1

    Please make a project on multi tenant schema package in django

    • @veryacademy
      @veryacademy  2 года назад +1

      Been asked a few times, I need a scenario or requirements, give me a bit more info as to what it is you are trying to achieve

    • @StephenGathoniOleSuyanka
      @StephenGathoniOleSuyanka 2 года назад

      @@veryacademy I have a scenario: Lets say you are creating a Hostel Management system a Saas project... so you have different hostels with different owners... the hostels can have caretakers, matron or patron, watchman (Security personel ) and students ... all these are different players with different roles...... in addition you can have also have a rating system for a student so when he/she moves from one hostel to another he/she can be accepted or rejected based on his/her ratings.... Got it now???

  • @ebrahimfawzy1916
    @ebrahimfawzy1916 Год назад

    After all these efforts, staff user can modify permission for himself.

  • @DilwarHossainNoorChandan
    @DilwarHossainNoorChandan 2 года назад +1

    Oh man!