Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/issue.rb2
-rw-r--r--app/models/project.rb8
-rw-r--r--app/models/project_team.rb8
3 files changed, 7 insertions, 11 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 6e8f5d3c422..dd0cb75f9a8 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -93,7 +93,7 @@ class Issue < ActiveRecord::Base
# Check if we are scoped to a specific project's issues
if owner_project
- if owner_project.authorized_for_user?(user, Gitlab::Access::REPORTER)
+ if owner_project.team.member?(user, Gitlab::Access::REPORTER)
# If the project is authorized for the user, they can see all issues in the project
return all
else
diff --git a/app/models/project.rb b/app/models/project.rb
index 76c1fc4945d..4408c29a54d 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1293,14 +1293,6 @@ class Project < ActiveRecord::Base
end
end
- # Checks if `user` is authorized for this project, with at least the
- # `min_access_level` (if given).
- def authorized_for_user?(user, min_access_level = nil)
- return false unless user
-
- user.authorized_project?(self, min_access_level)
- end
-
def append_or_update_attribute(name, value)
old_values = public_send(name.to_s)
diff --git a/app/models/project_team.rb b/app/models/project_team.rb
index 65549d8cd08..5845203055a 100644
--- a/app/models/project_team.rb
+++ b/app/models/project_team.rb
@@ -141,8 +141,12 @@ class ProjectTeam
max_member_access(user.id) == Gitlab::Access::MASTER
end
- def member?(user, min_member_access = Gitlab::Access::GUEST)
- max_member_access(user.id) >= min_member_access
+ # Checks if `user` is authorized for this project, with at least the
+ # `min_access_level` (if given).
+ def member?(user, min_access_level = Gitlab::Access::GUEST)
+ return false unless user
+
+ user.authorized_project?(project, min_access_level)
end
def human_max_access(user_id)