Skip to content
代码片段 群组 项目
提交 694768e5 编辑于 作者: Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
浏览文件

Fix 404 if Group guest visit empty group page

上级 0235c2a7
No related branches found
No related tags found
无相关合并请求
...@@ -110,7 +110,7 @@ def project_ids ...@@ -110,7 +110,7 @@ def project_ids
# Dont allow unauthorized access to group # Dont allow unauthorized access to group
def authorize_read_group! def authorize_read_group!
unless projects.present? or can?(current_user, :manage_group, @group) unless projects.present? or can?(current_user, :read_group, @group)
return render_404 return render_404
end end
end end
......
...@@ -135,6 +135,10 @@ def project_admin_rules ...@@ -135,6 +135,10 @@ def project_admin_rules
def group_abilities user, group def group_abilities user, group
rules = [] rules = []
if group.users.include?(user)
rules << :read_group
end
# Only group owner and administrators can manage group # Only group owner and administrators can manage group
if group.owners.include?(user) || user.admin? if group.owners.include?(user) || user.admin?
rules << [ rules << [
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册