2014-10-07 09:05:24 -04:00
|
|
|
module Gitlab
|
|
|
|
class GitAccessWiki < GitAccess
|
2016-12-06 08:10:27 -05:00
|
|
|
def guest_can_download_code?
|
2016-11-29 13:59:25 -05:00
|
|
|
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
|
|
|
|
|
2016-11-11 09:26:05 -05:00
|
|
|
def check_single_change_access(change)
|
2016-07-18 04:16:56 -04:00
|
|
|
if user_access.can_do_action?(:create_wiki)
|
2014-11-14 11:23:55 -05:00
|
|
|
build_status_object(true)
|
|
|
|
else
|
2015-05-10 17:07:35 -04:00
|
|
|
build_status_object(false, "You are not allowed to write to this project's wiki.")
|
2014-11-14 11:23:55 -05:00
|
|
|
end
|
2014-10-07 09:05:24 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|