<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    MDA/MDD/TDD/DDD/DDDDDDD
    posts - 536, comments - 111, trackbacks - 0, articles - 0
      BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

    rails應(yīng)用的認(rèn)證和授權(quán)

    Posted on 2010-02-14 21:00 leekiang 閱讀(577) 評(píng)論(0)  編輯  收藏 所屬分類: ruby
    ?一個(gè)帶完整的RBAC授權(quán)系統(tǒng)的rails應(yīng)用
    http://www.javaeye.com/topic/215074

    RESTful_ACL


    declarative_authorization
    aegis
    cancan?????????? http://github.com/ryanb/cancan
    Authologic
    acl9???????????? http://github.com/be9/acl9
    role_requirement http://github.com/timcharper/role_requirement
    ActiveRbac


    restful_authentication
    1,ruby script/plugin install http://svn.techno-weenie.net/projects/plugins/restful_authentication/
    項(xiàng)目右鍵->rails 插件->資源庫(kù)里添加url:http://svn.techno-weenie.net/projects/plugins
    ->新插件里找到restful_authentication然后安裝
    2, ruby script/generate authenticated user sessions
    Right-click on your application in the projects pane and choose ?
    "Generate". In the dialog box that comes up, choose "authenticated" ?
    from the drop-down "Generator" menu near the top, and in the arguments ?
    field enter "user sessions" (without the quotes). Hit OK.
    ----------------------------------------------------------------------
    Don't forget to:

    Try these for some familiar login URLs if you like:

    map.activate '/activate/:activation_code', :controller => 'users', :action => 'activate', :activation_code => nil
    map.signup '/signup', :controller => 'users', :action => 'new'
    map.login '/login', :controller => 'sessions', :action => 'new'
    map.logout '/logout', :controller => 'sessions', :action => 'destroy'

    ----------------------------------------------------------------------
    ????? create? app/views/sessions
    ????? create? app/views/users
    ????? create? app/models/user.rb
    ????? create? app/controllers/sessions_controller.rb
    ????? create? app/controllers/users_controller.rb
    ????? create? lib/authenticated_system.rb
    ????? create? lib/authenticated_test_helper.rb
    ????? create? test/functional/sessions_controller_test.rb
    ????? create? test/functional/users_controller_test.rb
    ????? create? test/unit/user_test.rb
    ????? create? test/fixtures/users.yml
    ????? create? app/helpers/sessions_helper.rb
    ????? create? app/helpers/users_helper.rb
    ????? create? app/views/sessions/new.html.erb
    ????? create? app/views/users/new.html.erb
    ????? create? db/migrate/20100218184435_create_users.rb
    ????? route? map.resource :session
    ????? route? map.resources :users

    運(yùn)行測(cè)試時(shí)要把SessionsControllerTest和UsersControllerTest都改為繼承ActionController::TestCase,同時(shí)把fixtures :users注釋掉。

    要使用current_user和logged_in? helper方法的話要在ApplicationController里include?AuthenticatedSystem?

    resource與resources的區(qū)別見(jiàn)http://api.rubyonrails.org/classes/ActionController/Resources.html

    http://www.javaeye.com/topic/353831
    http://www.javaeye.com/topic/177508
    http://hideto.javaeye.com/blog/115157
    https://github.com/nakajima/roleful
    主站蜘蛛池模板: 91亚洲自偷手机在线观看| 免费又黄又硬又爽大片| 88av免费观看| 久久精品视频免费看| 日韩精品无码免费专区午夜| 国产成人无码免费网站| 最近免费中文字幕中文高清| 久青草视频97国内免费影视| 巨胸喷奶水www永久免费| 中文永久免费观看网站| 国产国产人免费人成成免视频| 一级全免费视频播放| 中国黄色免费网站| 日韩精品在线免费观看| 2015日韩永久免费视频播放| 99久久国产热无码精品免费| 亚洲第一成年免费网站| 日韩在线免费播放| 亚洲一级片免费看| 日本红怡院亚洲红怡院最新 | 久久国产一片免费观看| 成全在线观看免费观看大全 | 亚洲欧洲无码一区二区三区| 亚洲狠狠婷婷综合久久蜜芽| 午夜亚洲国产精品福利| a在线视频免费观看在线视频三区| 四虎影视无码永久免费| 4虎1515hh永久免费| 午夜一区二区免费视频| 久久久久亚洲?V成人无码| 亚洲AV日韩AV天堂一区二区三区 | 国产色婷婷精品免费视频| 亚洲AV无码成人精品区大在线| 久久精品夜色噜噜亚洲A∨| 亚洲AV日韩AV天堂一区二区三区| 亚洲国产成人无码av在线播放| 亚洲AV无码一区二区大桥未久| 国产99视频精品免费视频76| 5555在线播放免费播放| 浮力影院第一页小视频国产在线观看免费| 亚洲А∨精品天堂在线|