Create dependency proxy policy classes for each supported user type
Originally, the dependency proxy policies were all inside app/policies/group_policy.rb
. This can be confusing, because Dependency Proxy for Containers deals with
To reduce the confusion, in !141358 (merged), we created a new policy for handling app/policies/packages/policies/dependency_proxy/group_policy.rb
.
We can still improve on this. There are still differences between the different tokens handled by app/policies/packages/policies/dependency_proxy/group_policy.rb
. For example:
- for personal access tokens and group access tokens, to check if the token user has access to the dependency proxy group, we call
#access_level
- for deploy tokens, we call
<token_user>.has_access_to_group?
To remove the confusion, we should split app/policies/packages/policies/dependency_proxy/group_policy.rb
into two or more policy classes.
We might also consider putting the group deploy token policy into DeployTokenPolicy