mirror of
https://0xacab.org/sutty/sutty
synced 2025-02-21 11:01:47 +00:00
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!
|
before_action :authenticate!
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
authorize Post
|
||||||
@site = find_site
|
@site = find_site
|
||||||
authorize @site
|
|
||||||
@lang = find_lang(@site)
|
@lang = find_lang(@site)
|
||||||
@category = session[:category] = params.dig(:category)
|
@category = session[:category] = params.dig(:category)
|
||||||
@posts = policy_scope(@site.posts_for(@lang), policy_scope_class: PostPolicy::Scope)
|
@posts = policy_scope(@site.posts_for(@lang), policy_scope_class: PostPolicy::Scope)
|
||||||
|
|
|
@ -6,9 +6,9 @@ class SitePolicy < SuttyPolicy
|
||||||
@site = site
|
@site = site
|
||||||
end
|
end
|
||||||
|
|
||||||
# Todxs lxs usuarixs pueden ver el índice
|
# Solo las usuarias
|
||||||
def index?
|
def index?
|
||||||
true
|
usuaria?
|
||||||
end
|
end
|
||||||
|
|
||||||
# Todxs lxs usuarixs pueden ver el sitio
|
# Todxs lxs usuarixs pueden ver el sitio
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
%ol.breadcrumb
|
%ol.breadcrumb
|
||||||
%li.breadcrumb-item= render 'login/logout'
|
%li.breadcrumb-item= render 'login/logout'
|
||||||
- crumbs.compact.each do |crumb|
|
- crumbs.compact.each do |crumb|
|
||||||
|
- if current_user.is_a? Invitadx
|
||||||
|
- if /\/sites/ =~ crumb
|
||||||
|
- next
|
||||||
- if crumb == crumbs.last
|
- if crumb == crumbs.last
|
||||||
%li.breadcrumb-item.active{'aria-current': 'page'}= crumb
|
%li.breadcrumb-item.active{'aria-current': 'page'}= crumb
|
||||||
- else
|
- else
|
||||||
|
|
|
@ -24,5 +24,6 @@ module Sutty
|
||||||
# Settings in config/environments/* take precedence over those specified here.
|
# Settings in config/environments/* take precedence over those specified here.
|
||||||
# Application configuration should go into files in config/initializers
|
# Application configuration should go into files in config/initializers
|
||||||
# -- all .rb files in that directory are automatically loaded.
|
# -- all .rb files in that directory are automatically loaded.
|
||||||
|
config.action_dispatch.rescue_responses['Pundit::NotAuthorizedError'] = :forbidden
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue