mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-13 13:21:29 +00:00
Fixing path to administrate view and added permission checks to controller
This commit is contained in:
parent
29d447e97b
commit
0f0393ecc5
3 changed files with 5 additions and 1 deletions
|
@ -1,9 +1,10 @@
|
||||||
class CustomUrlsController < ApplicationController
|
class CustomUrlsController < ApplicationController
|
||||||
def administrate
|
def administrate
|
||||||
|
raise AccessError unless cuser && cuser.admin?
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
raise AccessError unless request.xhr?
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
@ -15,8 +16,10 @@ class CustomUrlsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
raise AccessError unless request.xhr?
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
raise AccessError unless request.xhr?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,5 +18,6 @@
|
||||||
<li><%= link_to "Contests", contests_path %></li>
|
<li><%= link_to "Contests", contests_path %></li>
|
||||||
<li><%= link_to "Challenges", challenges_path %></li>
|
<li><%= link_to "Challenges", challenges_path %></li>
|
||||||
<li><%= link_to "Maps", maps_path %></li>
|
<li><%= link_to "Maps", maps_path %></li>
|
||||||
|
<li><%= link_to "Custom Article URLs", custom_urls_path %></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue