<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 :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

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

    Posted on 2010-02-14 21:00 leekiang 閱讀(575) 評(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 插件->資源庫里添加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ū)別見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
    主站蜘蛛池模板: 精选影视免费在线 | 老司机69精品成免费视频| 亚洲精品成人久久久| 永久免费av无码网站yy| 亚洲国产精品人久久电影| 在线观看亚洲免费视频| 青青操视频在线免费观看| 亚洲精品456在线播放| 日本高清免费不卡在线| 免费在线黄色电影| 亚洲色大成网站www久久九| 亚洲一级特黄大片无码毛片| 少妇无码一区二区三区免费| 亚洲欧美日韩中文字幕一区二区三区| 亚洲综合色视频在线观看| 久久久久高潮毛片免费全部播放| 亚洲AV无码一区二区三区鸳鸯影院| 久久精品国产69国产精品亚洲| 最近最好的中文字幕2019免费| 中文字幕在线视频免费观看| 亚洲天堂免费在线| 亚洲高清国产拍精品26U| 日本免费人成黄页网观看视频| 在线毛片片免费观看| 激情小说亚洲图片| 亚洲精品在线免费观看| 亚洲精品A在线观看| 九九九精品成人免费视频| 久久99免费视频| 羞羞的视频在线免费观看| 久久久久se色偷偷亚洲精品av | 日日摸日日碰夜夜爽亚洲| 亚洲国产成人久久综合一| 四虎永久免费影院| 国产香蕉免费精品视频| 免费看黄的成人APP| 国产亚洲福利一区二区免费看| 亚洲成无码人在线观看| 国产av天堂亚洲国产av天堂| 国产精品极品美女免费观看| 久久国内免费视频|