forked from padrino/padrino-web-classic
/
app.rb
28 lines (24 loc) · 759 Bytes
/
app.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class Admin < Padrino::Application
register Padrino::Helpers
register Padrino::Mailer
register Padrino::Admin::AccessControl
# App setting
set :email_from, "Padrino WebSite <noreply@padrinorb.com>"
set :domain, "http://www.padrinorb.com"
# Authentication
enable :authentication
disable :store_location
set :login_page, "/admin/sessions/new"
access_control.roles_for :any do |role|
role.protect "/"
role.allow "/sessions"
end
access_control.roles_for :admin do |role, account|
role.allow "/page_labels"
role.allow "/categories"
role.project_module :pages, "/pages"
role.project_module :guides, "/guides"
role.project_module :posts, "/posts"
role.project_module :accounts, "/accounts"
end
end