pundit v0.2.0 Pundit.DefaultPolicy behaviour View Source
Default access policies for a given type.
All of the functions here are named for actions in a Phoenix controller.
If you use
this module, then default implementations will be added in your module that all
return false
by default (default safe, nothing is permitted). All are overrideable.
Link to this section Summary
Callbacks
Returns true only if the user should be allowed to create a new kind of thing
Returns true only if the user should be allowed to delete a thing
Returns true only if the user should be allowed to see a form for updating the thing
Returns true only if the user should be allowed to see an index (list) of the given things
Returns true only if the user should be allowed to see a form to create a new thing
Returns true only if the user should be allowed to see the given thing
Returns true only if the user should be allowed to update the attributes of a thing
Link to this section Callbacks
create?(thing, user) View Source
Returns true only if the user should be allowed to create a new kind of thing.
delete?(thing, user) View Source
Returns true only if the user should be allowed to delete a thing.
edit?(thing, user) View Source
Returns true only if the user should be allowed to see a form for updating the thing.
See the page on Phoenix controllers for more details on the purpose of this action.
index?(thing, user) View Source
Returns true only if the user should be allowed to see an index (list) of the given things.
new?(thing, user) View Source
Returns true only if the user should be allowed to see a form to create a new thing.
See the page on Phoenix controllers for more details on the purpose of this action.
show?(thing, user) View Source
Returns true only if the user should be allowed to see the given thing.
update?(thing, user) View Source
Returns true only if the user should be allowed to update the attributes of a thing.