Canister feature admins only
This commit is contained in:
parent
0cb2fb1dce
commit
0c75a358fd
@ -3,7 +3,8 @@ class VisitorsController < ApplicationController
|
||||
|
||||
def index
|
||||
@doodads = authorize policy_scope(Doodad)
|
||||
@canisters = authorize Canister.all
|
||||
# todo Canister feature
|
||||
# @canisters = authorize Canister.all
|
||||
@feed_items = current_user.feed.paginate(page: params[:page])
|
||||
end
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ class CanisterPolicy
|
||||
|
||||
|
||||
def index?
|
||||
@current_user.admin? || true
|
||||
@current_user.admin?
|
||||
end
|
||||
|
||||
def show?
|
||||
@ -35,11 +35,12 @@ class CanisterPolicy
|
||||
end
|
||||
|
||||
def create?
|
||||
@current_user.admin? || true
|
||||
@current_user.admin?
|
||||
end
|
||||
|
||||
def new?
|
||||
@current_user.present?
|
||||
# @current_user.present?
|
||||
@current_user.admin?
|
||||
end
|
||||
|
||||
def edit?
|
||||
|
||||
@ -8,7 +8,9 @@
|
||||
<li><%= link_to 'Profiles', profiles_path %></li>
|
||||
<li><%= link_to 'Projects', projects_path %></li>
|
||||
<li><%= link_to 'MetaPurse', metapurses_path %></li>
|
||||
<li><%= link_to 'Canisters', canisters_path %></li>
|
||||
<% if policy(:canister).index? %>
|
||||
<li><%= link_to 'Canisters', canisters_path %></li>
|
||||
<% end %>
|
||||
<li><%= link_to 'Doodads', doodads_path, data: { turbo: false } %></li>
|
||||
<% if policy(:bot).index? %>
|
||||
<li><%= link_to 'Bots', bots_path %></li>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user