debian-mirror-gitlab/lib/gitlab/git_access_wiki.rb

20 lines
542 B
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
module Gitlab
class GitAccessWiki < GitAccess
2017-08-17 22:00:37 +05:30
def guest_can_download_code?
Guest.can?(:download_wiki_code, project)
end
def user_can_download_code?
authentication_abilities.include?(:download_code) && user_access.can_do_action?(:download_wiki_code)
end
def check_single_change_access(change)
2016-08-24 12:49:21 +05:30
if user_access.can_do_action?(:create_wiki)
2015-04-26 12:48:37 +05:30
build_status_object(true)
else
2015-09-11 14:41:01 +05:30
build_status_object(false, "You are not allowed to write to this project's wiki.")
2015-04-26 12:48:37 +05:30
end
end
end
end