You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling grant! and revoke! on a policy the return value is always nil. A common paradigm when using accessly might be to grant a permission, and then do one thing if that grant was newly successful and another if it was not.
Since these are "command" methods, I would not advocate that they should return a value that indicates this (such as true or false), but potentially it returns "self" and there is a "query" type method we can then call on the policy to find out if the most recent grant attempt was successful? Then you could write code like:
There could be the above method for generic "something has changed" status, and maybe there could also be more specific way to retrieve what changed like:
rreinhardt9
changed the title
Return value of grant! and revoke! is always nil and provides no success information
Add ability to query if permissions have changed to policies
Oct 11, 2018
When calling
grant!
andrevoke!
on a policy the return value is always nil. A common paradigm when using accessly might be to grant a permission, and then do one thing if that grant was newly successful and another if it was not.Since these are "command" methods, I would not advocate that they should return a value that indicates this (such as true or false), but potentially it returns "self" and there is a "query" type method we can then call on the policy to find out if the most recent grant attempt was successful? Then you could write code like:
There could be the above method for generic "something has changed" status, and maybe there could also be more specific way to retrieve what changed like:
The text was updated successfully, but these errors were encountered: