Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 598319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:22:33+00:00 2026-05-13T16:22:33+00:00

(Disclaimer: I am very new to rails) This plugin looks like it will be

  • 0

(Disclaimer: I am very new to rails)

This plugin looks like it will be a great fit for my app, but I am
having a hard time getting it to work. I am using it with authlogic, I
am not sure if that is the problem, but it seems like it may be.

When I try an access a page that my admin role should have access to I
get this:

Processing CompaniesController#show (for 127.0.0.1 at 2010-02-12
23:26:44) [GET]
Parameters: {"action"=>"show", "id"=>"1", "controller"=>"companies",
"battalion_id"=>"1"}
User Load (0.000681)   SELECT * FROM "users" WHERE ("users"."id" =
'147') LIMIT 1
User Update (0.000622)   UPDATE "users" SET "perishable_token" =
'tUyTl1eZDQSJwp_PFw7c', "last_request_at" = '2010-02-13 05:26:44',
"updated_at" = '2010-02-13 05:26:44' WHERE "id" = 147
Role Load (0.000334)   SELECT * FROM "roles" WHERE ("roles".user_id
= 147)
Permission denied: No matching rules found for show for #<User id:
147, user_type: nil, login: "lauren_roth", name: "Lauren
Rothlisberger", email: "laurenrothlisber...@gmail.com",
crypted_password:
"d835a2cdf15ef449d0980e706fd86d7a9a7a0a23d0d79d6f18f...",
 password_salt: "_Qz_z8eZOhKHcsPsBsoP", created_at: "2010-02-12
 16:37:53", updated_at: "2010-02-13 05:26:44", old_remember_token: nil,
 old_remember_token_expires_at: nil, old_activation_code: nil,
 activated_at: nil, old_password_reset_code: nil, enabled: true,
 identity_url: nil, invitation_id: nil, invitation_limit: nil,
 position: "Admin", battalion_id: nil, company_id: nil, soldier_id:
 nil, login_count: 68, failed_login_count: 0, last_request_at:
 "2010-02-13 05:26:44", current_login_at: "2010-02-13 05:20:59",
 last_login_at: "2010-02-13 05:19:57", current_login_ip: "127.0.0.1",
 last_login_ip: "127.0.0.1", persistence_token:
 "28fc9b60853045cd4e43a001b4258940a7e8f9ac50b08df6a6d...",
 single_access_token: "bKgYvuRtLqauufljZDoV", perishable_token:
 "tUyTl1eZDQSJwp_PFw7c", active: true, platoon_id: nil> (roles
 [:Admin], privileges [:show], context :companies).
 Filter chain halted as [:filter_access_filter] rendered_or_redirected.
 Completed in 27ms (View: 1, DB: 0 3 queries) | 403 Forbidden [http://
 localhost/battalions/1/companies/1]

I have this in my User model
def role_symbols
(roles || []).map {|r| r.name.to_sym}
end

But it doesn’t seem to be calling that. I think that may be the
heart of the problem, but I am also wondering if it has anything to do
with the user_sessions?

Also this is what my application_controller looks like:

 helper_method :current_user_session, :current_user
 filter_parameter_logging :password, :password_confirmation

  before_filter :set_current_user
  protected
  def set_current_user
    Authorization.current_user = current_user
  end

  def current_user_session
    return @current_user_session if defined? (@current_user_session)
    @current_user_session = UserSession.find
  end

  def current_user
    return @current_user if defined?(@current_user)
    @current_user = current_user_session && current_user_session.record
  end

  def store_location
    session[:return_to] = request.request_uri
  end

  def redirect_back_or_default(default)
    redirect_to(session[:return_to] || default)
    session[:return_to] = nil
  end


Here is my authorization_rules.rb

I did capitalize the Admin to reflect that:

authorization do
   role :guest do
    has_permission_on :user_sessions, :to => [:create, :update]
   end

   role :Admin do
     has_permission_on :companies, :to => [:index, :show]
   end
 end 

If you have any ideas I would greatly appreciate it. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:22:33+00:00Added an answer on May 13, 2026 at 4:22 pm

    Apparently the application loads the rules of table roles properly, but don’t load the config/authorization_rules.rb file correctly. Please check the file, his name and the syntax used.

    Try to use the privileges section in authorization_rules.rb; like this:

    privileges do
      privilege :manage, :includes => [:create, :read, :update, :delete]
      privilege :read, :includes => [:index, :show]
      privilege :create, :includes => :new
      privilege :update, :includes => :edit
      privilege :delete, :includes => :destroy
    end
    

    And what about the Companies controller?


    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let me preface this with the disclaimer that I am very new to multithreading
Disclaimer : This is a very basic question, but keep in mind I come
I have a WPF sorting/binding issue. (Disclaimer: I am very new to WPF and
Disclaimer: I am using ExtJS 3, but I don't think it's very relevant to
A quick disclaimer: I'm very new to P/Invoke, so I apologize in advance if
Disclaimer: I'm very new to SQL and databases in general. I need to create
(Disclaimer: New to Rails here) Say I have a Rails ActiveRecord Model that responds
Disclaimer: I am very new to iOS development. Please excuse the possible stupidity of
Disclaimer: I'm very new to Django. I must say that so far I really
Disclaimer: I understand the question is very basic, but I could not find the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.