Fixing path to administrate view and added permission checks to controller

This commit is contained in:
Absurdon 2017-11-10 12:12:03 +01:00 committed by Absurdon
parent 29d447e97b
commit 0f0393ecc5
3 changed files with 5 additions and 1 deletions

View file

@ -1,9 +1,10 @@
class CustomUrlsController < ApplicationController
def administrate
raise AccessError unless cuser && cuser.admin?
end
def create
raise AccessError unless request.xhr?
end
def show
@ -15,8 +16,10 @@ class CustomUrlsController < ApplicationController
end
def update
raise AccessError unless request.xhr?
end
def destroy
raise AccessError unless request.xhr?
end
end

View file

@ -18,5 +18,6 @@
<li><%= link_to "Contests", contests_path %></li>
<li><%= link_to "Challenges", challenges_path %></li>
<li><%= link_to "Maps", maps_path %></li>
<li><%= link_to "Custom Article URLs", custom_urls_path %></li>
</ul>
</div>