-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Developers can push to wiki repo. Protected branches does not affect …
…wiki repo any more Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
- Loading branch information
1 parent
8fad7e6
commit 0bf99f6
Showing
4 changed files
with
63 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module Gitlab | ||
class GitAccessWiki < GitAccess | ||
def change_allowed?(user, project, change) | ||
user.can?(:write_wiki, project) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require 'spec_helper' | ||
|
||
describe Gitlab::GitAccessWiki do | ||
let(:access) { Gitlab::GitAccessWiki.new } | ||
let(:project) { create(:project) } | ||
let(:user) { create(:user) } | ||
|
||
describe 'push_allowed?' do | ||
before do | ||
create(:protected_branch, name: 'master', project: project) | ||
project.team << [user, :developer] | ||
end | ||
|
||
subject { access.push_allowed?(user, project, changes) } | ||
|
||
it { should be_true } | ||
end | ||
|
||
def changes | ||
['6f6d7e7ed 570e7b2ab refs/heads/master'] | ||
end | ||
end |