diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-07-29 10:01:15 +0300 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-07-29 12:50:39 +0300 |
commit | cebcc417eda08711ad17a433d6d9b4f49830c04c (patch) | |
tree | 08276afb13fe04b41b6d7a20df0cd11962fa9a6c /app/models/protected_branch/push_access_level.rb | |
parent | 0a8aeb46dc187cc309ddbe23d8624f5d24b6218c (diff) |
Implement final review comments from @rymai.
1. Instantiate `ProtectedBranchesAccessSelect` from `dispatcher`
2. Use `can?(user, ...)` instead of `user.can?(...)`
3. Add `DOWNTIME` notes to all migrations added in !5081.
4. Add an explicit `down` method for migrations removing the
`developers_can_push` and `developers_can_merge` columns, ensuring that
the columns created (on rollback) have the appropriate defaults.
5. Remove duplicate CHANGELOG entries.
6. Blank lines after guard clauses.
Diffstat (limited to 'app/models/protected_branch/push_access_level.rb')
-rw-r--r-- | app/models/protected_branch/push_access_level.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/protected_branch/push_access_level.rb b/app/models/protected_branch/push_access_level.rb index 1999316aa26..6a5e49cf453 100644 --- a/app/models/protected_branch/push_access_level.rb +++ b/app/models/protected_branch/push_access_level.rb @@ -17,6 +17,7 @@ class ProtectedBranch::PushAccessLevel < ActiveRecord::Base def check_access(user) return false if access_level == Gitlab::Access::NO_ACCESS return true if user.is_admin? + project.team.max_member_access(user.id) >= access_level end |