Closed vittorius closed 8 years ago
Update: looks like block works only when checking the User
instances. But why would such definition permit any operation on class?
@vittorius can you document the solution you used to get the block to execute?
It's a dumb hack )
<% if current_user.has_privileges?(:admin) %>
(has_privileges?
is just my method for model User which checks the it's in appropriate role)
@vittorius
Update: looks like block works only when checking the User instances. But why would such definition permit any operation on class?
you are not meant to use :destroy
or :update
on classes. Because it doesn't make sense, you can't remove or update a class.
So the only permission you usually need to check on a class is :create
.
If you want to allow someone to view users, specify the can :read, User
separately from :update and :create
Hello.
I have such policy:
and check
When I add
byebug
to policy block the execution even doesn't get stopped. So, looks like it looks atUser
at decides that it's enough.Only when I comment out the policy definition, the check works.