Description:
[web] disable sites_controller from normal users
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@247 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r119:cf9b6fbe5680 - - 1 file changed: 3 inserted, 0 deleted
@@ -1,25 +1,28 | |||||
|
1 | class SitesController < ApplicationController |
|
1 | class SitesController < ApplicationController |
|
|
2 | + | ||
|
|
3 | + before_filter :admin_authorization | ||
|
|
4 | + | ||
|
2 | # GET /sites |
|
5 | # GET /sites |
|
3 | # GET /sites.xml |
|
6 | # GET /sites.xml |
|
4 | def index |
|
7 | def index |
|
5 | @sites = Site.find(:all) |
|
8 | @sites = Site.find(:all) |
|
6 |
|
9 | ||
|
7 | respond_to do |format| |
|
10 | respond_to do |format| |
|
8 | format.html # index.html.erb |
|
11 | format.html # index.html.erb |
|
9 | format.xml { render :xml => @sites } |
|
12 | format.xml { render :xml => @sites } |
|
10 | end |
|
13 | end |
|
11 | end |
|
14 | end |
|
12 |
|
15 | ||
|
13 | # GET /sites/1 |
|
16 | # GET /sites/1 |
|
14 | # GET /sites/1.xml |
|
17 | # GET /sites/1.xml |
|
15 | def show |
|
18 | def show |
|
16 | @site = Site.find(params[:id]) |
|
19 | @site = Site.find(params[:id]) |
|
17 |
|
20 | ||
|
18 | respond_to do |format| |
|
21 | respond_to do |format| |
|
19 | format.html # show.html.erb |
|
22 | format.html # show.html.erb |
|
20 | format.xml { render :xml => @site } |
|
23 | format.xml { render :xml => @site } |
|
21 | end |
|
24 | end |
|
22 | end |
|
25 | end |
|
23 |
|
26 | ||
|
24 | # GET /sites/new |
|
27 | # GET /sites/new |
|
25 | # GET /sites/new.xml |
|
28 | # GET /sites/new.xml |
You need to be logged in to leave comments.
Login now