Created
May 20, 2009 03:01
-
-
Save baldwindavid/114585 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Comatose.configure do |config| | |
| config.admin_includes << :your_authentication_module | |
| config.admin_authorization = :your_auth_before_filter_method | |
| config.admin_get_root_page do | |
| if current_user.role == 'troop_leader' | |
| ComatosePage.find_by_path( "troops/troop_#{current_user.troop_id}" ) | |
| elsif current_user.role == 'overall_troop_manager' | |
| # Returns multiple 'roots' | |
| [ | |
| ComatosePage.find_by_path( 'troops' ), | |
| ComatosePage.find_by_path( 'help' ) | |
| ] | |
| elsif current_user.role == 'super_admin' | |
| ComatosePage.root | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment