lib/miau.rb in miau-1.1.6 vs lib/miau.rb in miau-1.1.7
- old
+ new
@@ -42,9 +42,14 @@
def authorize_controller!
controller = params[:controller].to_sym
action = params[:action].to_sym
policy = PolicyStorage.instance.find_or_create_policy(controller)
+ unless policy
+ msg = "missing class #{controller.capitalize}Policy"
+ raise NotDefinedError, msg
+ end
+
policy.user = miau_user
policy.action = action
@_miau_authorization_performed = true
return true if PolicyRun.instance.runs(policy, :controller)