lib/eucalypt/eucalypt-security/namespaces/security-pundit/templates/pundit.tt in eucalypt-0.1.3 vs lib/eucalypt/eucalypt-security/namespaces/security-pundit/templates/pundit.tt in eucalypt-0.2.0
- old
+ new
@@ -1,4 +1,11 @@
class ApplicationController < Sinatra::Base
# Include Pundit for authorization
include Pundit
+
+ helpers do
+ def authorized?(policy, permission)
+ return false unless authenticated?
+ policy(policy).send permission
+ end
+ end
end
\ No newline at end of file