1

What I would like to do is to set view permissions of certain parts of the site depending on the user (that is easy using permissions and guardian).

I have a set of buttons across the top of the page. For one or two buttons I want to set permissions for only a few users or groups to be able to see that button. That part is fine (using guardian).

Each button is related to a model instance. The model has a view_button permission. Is there a way to have the view_button permission be default to True if the permissions is empty? Or, is there a way of saying has_perm be True for all users?

Maybe I could just create a static method within the model that does that check for me. Is there a better way to do it?

Rashwan L
  • 38,237
  • 7
  • 103
  • 107
brechmos
  • 1,278
  • 1
  • 11
  • 22

0 Answers0