Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Protect admin space

  • Loading branch information...
commit b7c09a078f0a6bb4a4d4b077bdb32f02e1e08606 1 parent 3094083
@marktabler authored
View
3  app/controllers/admin/licenses_controller.rb
@@ -1,2 +1,5 @@
class Admin::LicensesController < ApplicationController
+
+ before_filter :admin_required
+
end
View
3  app/controllers/admin/machines_controller.rb
@@ -1,2 +1,5 @@
class Admin::MachinesController < ApplicationController
+
+ before_filter :admin_required
+
end
View
3  app/controllers/admin/users_controller.rb
@@ -1,2 +1,5 @@
class Admin::UsersController < ApplicationController
+
+ before_filter :admin_required
+
end
View
5 app/controllers/users_controller.rb
@@ -1,5 +0,0 @@
-class UsersController < ApplicationController
-
- before_filter :admin_required
-
-end
View
2  app/views/layouts/application.html.erb
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title><%= content_for?(:title) ? yield(:title) : "Myapp" %></title>
+ <title><%= content_for?(:title) ? yield(:title) : "Norrington" %></title>
<meta name="description" content="">
<meta name="author" content="">
<%= stylesheet_link_tag "application", :media => "all" %>
View
8 config/routes.rb
@@ -11,10 +11,14 @@
resources :licenses
- resources :users
-
resources :machines
+ namespace :admin do
+ resources :users
+ resources :machines
+ resources :licenses
+ end
+
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
Please sign in to comment.
Something went wrong with that request. Please try again.