sonarqube-5.2/web/WEB-INF/app/helpers/users_helper.rb
#
# Use this to wrap view elements that the user can't access.
# !! Note: this is an *interface*, not *security* feature !!
# You need to do all access control at the controller level.
#
# Example:
# <%= if_authorized?(:index,   User)  do link_to('List all users', users_path) end %> |
# <%= if_authorized?(:edit,    @user) do link_to('Edit this user', edit_user_path) end %> |
# <%= if_authorized?(:destroy, @user) do link_to 'Destroy', @user, :confirm => 'Are you sure?', :method => :delete end %> 
#
#
Use this to wrap view elements that the user can't access.
Note: this is an *interface*, not *security* feature
You need to do all access control at the controller level.


Use this to wrap view elements that the user can ' t access . Note : this is an * interface * not * security * feature You need to do all access control at the controller level .
def if_authorized?(action, resource, &block)
    if authorized?(action, resource)
      yield action, resource
    end
  end
def if_authorized? ( action , resource , & block ) if authorized? ( action , resource ) yield action , resource end end
Use this to wrap view elements that the user can't access.
Use this to wrap view elements that the user can ' t access .
action
resource
block