我已配置爲使用authlogic和declarative_authorization並配置authorization_rules.rb。一切都很好,但試圖訪問本地主機/ authorization_rules我看到「你不能訪問這個動作。」我已經添加declarative_authorization和/ authorization_rules訪問問題
has_permission_on :authorization_rules, :to => [:index, :show]
,但什麼都沒有改變:(在日誌中我看到
Processing AuthorizationRulesController#index (for 127.0.0.1 at 2010-05-08 14:00:01) [GET]
Parameters: {"action"=>"index", "controller"=>"authorization_rules"}
User Load (1.0ms) SELECT * FROM "users" WHERE ("users"."id" = 1) LIMIT 1
SQL (1.8ms) BEGIN
User Update (0.6ms) UPDATE "users" SET "updated_at" = '2010-05-08 10:00:01.443532', "perishable_token" = E'Narj4gmDdGiCuna9p_ht', "last_request_at" = '2010-05-08 10:00:01.440280' WHERE "id" = 1
SQL (1.4ms) COMMIT
Role Load (1.3ms) SELECT "roles".* FROM "roles" INNER JOIN "assignments" ON "roles".id = "assignments".role_id WHERE (("assignments".user_id = 1))
Permission denied: No matching rules found for read for #<User id: 1, login: "alec", email: "[email protected]", crypted_password: "cb0af876f2ae63f40b82eb7b8eb24e1f739a3d80e6afd4e9e36...", password_salt: "SBdGRsh5roMoaYOANkHN", persistence_token: "e356eb5d39c032ca3088f2fe9868941f70c396a7ed7eb082028...", single_access_token: "nABARs1vURbXmp1Yuc6e", perishable_token: "Narj4gmDdGiCuna9p_ht", confirmed: true, active: true, activation_code: nil, activated_at: "2010-03-07 20:51:46", login_count: 9, failed_login_count: 0, last_request_at: "2010-05-08 10:00:01", current_login_at: "2010-04-09 18:38:24", last_login_at: "2010-04-06 20:03:25", current_login_ip: "127.0.0.1", last_login_ip: "127.0.0.1", friends_count: 0, created_at: "2010-03-07 20:51:20", updated_at: "2010-05-08 10:00:01"> (roles [:admin, :super_moderator, :news_moderator, :news_maker], privileges [:read], context :authorization_rules).
Filter chain halted as [:filter_access_filter] rendered_or_redirected.
什麼想法?
весело:)我檢查了我的配置和車型再次 - 相同的結果:(奇怪:( – 2010-05-17 21:28:25