diff options
author | Jacopo <beschi.jacopo@gmail.com> | 2017-11-14 10:02:39 +0100 |
---|---|---|
committer | Jacopo <beschi.jacopo@gmail.com> | 2017-11-16 17:58:29 +0100 |
commit | 181cd299f9e06223e8338e93b1c318c671ccb1aa (patch) | |
tree | 0d71dcf3f786496eaa46b9d65ce2626f162015da /lib/api/runners.rb | |
parent | f2997af4d5cdec3266d3178edeedc36d4e590062 (diff) | |
download | gitlab-ce-181cd299f9e06223e8338e93b1c318c671ccb1aa.tar.gz |
Adds Rubocop rule for line break after guard clause
Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
Diffstat (limited to 'lib/api/runners.rb')
-rw-r--r-- | lib/api/runners.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/runners.rb b/lib/api/runners.rb index d3559ef71be..e816fcdd928 100644 --- a/lib/api/runners.rb +++ b/lib/api/runners.rb @@ -165,17 +165,20 @@ module API def authenticate_show_runner!(runner) return if runner.is_shared || current_user.admin? + forbidden!("No access granted") unless user_can_access_runner?(runner) end def authenticate_update_runner!(runner) return if current_user.admin? + forbidden!("Runner is shared") if runner.is_shared? forbidden!("No access granted") unless user_can_access_runner?(runner) end def authenticate_delete_runner!(runner) return if current_user.admin? + forbidden!("Runner is shared") if runner.is_shared? forbidden!("Runner associated with more than one project") if runner.projects.count > 1 forbidden!("No access granted") unless user_can_access_runner?(runner) @@ -185,6 +188,7 @@ module API forbidden!("Runner is shared") if runner.is_shared? forbidden!("Runner is locked") if runner.locked? return if current_user.admin? + forbidden!("No access granted") unless user_can_access_runner?(runner) end |