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
Both the requires_permission and the forthcoming requires_roles decorators (in ModelView; see #179) should provide an is_available method that returns True if a call to the decorated function will be allowed by the decorator under current conditions. Templates can use this to determine whether to show functionality to the user.
Currently templates do their own testing using obj.current_roles.role or current_auth.permissions.perm. This is risky because it can go wrong in either direction. Templates may incorrectly assume that the user has access to some functionality, or worse, templates may assume no access while the backend does in fact provide access, leading to security vulnerabilities. If templates use the same testing mechanism as the backend, we get closer to WYSIWYG UI, making it easier to spot misconfiguration.
The text was updated successfully, but these errors were encountered:
Both the
requires_permission
and the forthcomingrequires_roles
decorators (in ModelView; see #179) should provide anis_available
method that returns True if a call to the decorated function will be allowed by the decorator under current conditions. Templates can use this to determine whether to show functionality to the user.Currently templates do their own testing using
obj.current_roles.role
orcurrent_auth.permissions.perm
. This is risky because it can go wrong in either direction. Templates may incorrectly assume that the user has access to some functionality, or worse, templates may assume no access while the backend does in fact provide access, leading to security vulnerabilities. If templates use the same testing mechanism as the backend, we get closer to WYSIWYG UI, making it easier to spot misconfiguration.The text was updated successfully, but these errors were encountered: