Skip to content

Instantly share code, notes, and snippets.

@baldwindavid
Created May 20, 2009 03:01
Show Gist options
  • Select an option

  • Save baldwindavid/114585 to your computer and use it in GitHub Desktop.

Select an option

Save baldwindavid/114585 to your computer and use it in GitHub Desktop.
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