diff options
| author | Mayra Cabrera <mcabrera@gitlab.com> | 2018-04-06 09:30:21 -0500 |
|---|---|---|
| committer | Mayra Cabrera <mcabrera@gitlab.com> | 2018-04-06 21:20:17 -0500 |
| commit | 29913816309c6f6387b20c8702bcc8e90ef3a984 (patch) | |
| tree | 6dbd8f3367d423a72c0d058d5e1a29296873c1f6 /app/services/auth | |
| parent | ca35c65b026e57307a13f25ebc11f11c978ed697 (diff) | |
| download | gitlab-ce-29913816309c6f6387b20c8702bcc8e90ef3a984.tar.gz | |
Addresses database comments
- Adds a default on expires_at datetime
- Modifies deploy tokens views to handle default expires at value
- Use datetime_with_timezone where possible
- Remove unused scopes
Diffstat (limited to 'app/services/auth')
| -rw-r--r-- | app/services/auth/container_registry_authentication_service.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/auth/container_registry_authentication_service.rb b/app/services/auth/container_registry_authentication_service.rb index 425ceb9c1a8..8f050072f74 100644 --- a/app/services/auth/container_registry_authentication_service.rb +++ b/app/services/auth/container_registry_authentication_service.rb @@ -124,8 +124,8 @@ module Auth end def can_user?(ability, project) - current_user.is_a?(User) && - can?(current_user, ability, project) + user = current_user.is_a?(User) ? current_user : nil + can?(user, ability, project) end def build_can_pull?(requested_project) @@ -143,7 +143,7 @@ module Auth def user_can_pull?(requested_project) has_authentication_ability?(:read_container_image) && - can?(current_user, :read_container_image, requested_project) + can_user?(:read_container_image, requested_project) end def deploy_token_can_pull?(requested_project) |
