5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 01:21:42 +00:00

lxs invitadxs no ven el indice de sitios

This commit is contained in:
f 2019-02-16 15:17:18 -03:00
parent f1fa18bfa5
commit 4dc08d9dbc
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7
4 changed files with 7 additions and 3 deletions

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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