Commit e59a8e9a authored by Serena Fang's avatar Serena Fang

Update group check comment

parent 896c57f8
...@@ -214,9 +214,9 @@ module Gitlab ...@@ -214,9 +214,9 @@ module Gitlab
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
# The generic implementation of resource access token is functional # A workaround for adding group-level automation is to add the bot user of a project access token as a group member.
# but requires an additional check to verify if the token user is a member of # In order to make project access tokens work this way during git authentication, we need to add an additional check for group membership.
# the project's group, its ancestor groups, or its shared groups. # This is a temporary workaround until service accounts are implemented.
def token_bot_in_group?(user, project) def token_bot_in_group?(user, project)
project.group && project.group.members_with_parents.where(user_id: user.id).exists? project.group && project.group.members_with_parents.where(user_id: user.id).exists?
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment