Add authorization
This commit is contained in:
parent
5608c79d42
commit
38758160fe
|
@ -9,8 +9,12 @@ class Admin::PageContentsController < OrbitAdminController
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
if can_edit_or_delete?(nil)
|
||||||
@page = Page.find(params[:page_id])
|
@page = Page.find(params[:page_id])
|
||||||
@page_content = PageContext.new
|
@page_content = PageContext.new
|
||||||
|
else
|
||||||
|
render_401
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|
|
@ -13,7 +13,9 @@
|
||||||
<a href="/<%= I18n.locale %><%= page.url %>" target="_blank"><%= page.name %></a>
|
<a href="/<%= I18n.locale %><%= page.url %>" target="_blank"><%= page.name %></a>
|
||||||
<div class="quick-edit">
|
<div class="quick-edit">
|
||||||
<ul class="nav nav-pills">
|
<ul class="nav nav-pills">
|
||||||
|
<% if can_edit_or_delete?(page) %>
|
||||||
<li><a href="/admin/page_contents/new?page_id=<%= page.id.to_s %>"><%= t(:edit) %></a></li>
|
<li><a href="/admin/page_contents/new?page_id=<%= page.id.to_s %>"><%= t(:edit) %></a></li>
|
||||||
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -9,7 +9,7 @@ module PageContent
|
||||||
|
|
||||||
side_bar do
|
side_bar do
|
||||||
head_label_i18n 'page_content.page', icon_class: "icons-newspaper"
|
head_label_i18n 'page_content.page', icon_class: "icons-newspaper"
|
||||||
available_for [:admin,:manager,:sub_manager]
|
available_for "users"
|
||||||
active_for_controllers (['admin/page_contents'])
|
active_for_controllers (['admin/page_contents'])
|
||||||
head_link_path "admin_page_contents_path"
|
head_link_path "admin_page_contents_path"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue