lxs invitadxs no ven el indice de sitios
This commit is contained in:
parent
f1fa18bfa5
commit
4dc08d9dbc
4 changed files with 7 additions and 3 deletions
|
@ -3,8 +3,8 @@ class PostsController < ApplicationController
|
|||
before_action :authenticate!
|
||||
|
||||
def index
|
||||
authorize Post
|
||||
@site = find_site
|
||||
authorize @site
|
||||
@lang = find_lang(@site)
|
||||
@category = session[:category] = params.dig(:category)
|
||||
@posts = policy_scope(@site.posts_for(@lang), policy_scope_class: PostPolicy::Scope)
|
||||
|
|
|
@ -6,9 +6,9 @@ class SitePolicy < SuttyPolicy
|
|||
@site = site
|
||||
end
|
||||
|
||||
# Todxs lxs usuarixs pueden ver el índice
|
||||
# Solo las usuarias
|
||||
def index?
|
||||
true
|
||||
usuaria?
|
||||
end
|
||||
|
||||
# Todxs lxs usuarixs pueden ver el sitio
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
%ol.breadcrumb
|
||||
%li.breadcrumb-item= render 'login/logout'
|
||||
- crumbs.compact.each do |crumb|
|
||||
- if current_user.is_a? Invitadx
|
||||
- if /\/sites/ =~ crumb
|
||||
- next
|
||||
- if crumb == crumbs.last
|
||||
%li.breadcrumb-item.active{'aria-current': 'page'}= crumb
|
||||
- else
|
||||
|
|
|
@ -24,5 +24,6 @@ module Sutty
|
|||
# Settings in config/environments/* take precedence over those specified here.
|
||||
# Application configuration should go into files in config/initializers
|
||||
# -- all .rb files in that directory are automatically loaded.
|
||||
config.action_dispatch.rescue_responses['Pundit::NotAuthorizedError'] = :forbidden
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue