Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

Final right on clean #13

Merged
merged 7 commits into from
Apr 13, 2018
Merged

Final right on clean #13

merged 7 commits into from
Apr 13, 2018

Conversation

mnoack
Copy link
Contributor

@mnoack mnoack commented Apr 13, 2018

  • Some missing requires
  • Improve error handling in ByGroup
  • Merging the controller extensions
  • Minor fixes

end

format.json do
render status: :unauthorized, json: @permission_denied_response.to_json

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [81/80]

format.html do
render status: :unauthorized,
template: 'permission_denied',
layout: ( permission_denied_layout || false )

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/SpaceInsideParens: Space inside parentheses detected.

end

def rescue_access_denied(exception)
@permission_denied_response = RightOn::PermissionDeniedResponse.new(params, controller_action_options)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [108/80]

can? :access, [params[:controller], params[:action]].join('#')
end

def rescue_access_denied(exception)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint/UnusedMethodArgument: Unused method argument - exception. If it's necessary, use _ or _exception as an argument name to indicate that it won't be used. You can also write as rescue_access_denied(*) if you want the method to accept any arguments but don't care about them.

@@ -10,14 +19,34 @@ def authorize_action!
end

def can_access_controller_action?(controller, action)
(can?(:access, controller) && !Right.where(subject: controller + '#' + action).exists?) ||
(can?(:access, controller) && !Right.where(ccr_subject: controller + '#' + action).exists?) ||

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [100/80]

@@ -42,7 +42,9 @@ def action_rights(controller, actions)
end

def rights_by_name!(name)
@rights_by_name[name] or fail name.inspect
@rights_by_name[name] or fail RightOn::RightNotFound, name.inspect

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/AndOr: Use || instead of or.

@coveralls
Copy link

coveralls commented Apr 13, 2018

Coverage Status

Coverage increased (+0.6%) to 92.949% when pulling c493e1f on final_right_on_clean into ca54b0a on master.

4 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 92.949% when pulling c493e1f on final_right_on_clean into ca54b0a on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 92.949% when pulling c493e1f on final_right_on_clean into ca54b0a on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 92.949% when pulling c493e1f on final_right_on_clean into ca54b0a on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 92.949% when pulling c493e1f on final_right_on_clean into ca54b0a on master.

@mnoack mnoack merged commit 6e27712 into master Apr 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants