BigW Consortium Gitlab

git_access_wiki.rb 534 Bytes
Newer Older
1 2
module Gitlab
  class GitAccessWiki < GitAccess
3 4 5 6 7 8 9 10
    def guest_can_downlod_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

11
    def change_access_check(change)
12
      if user_access.can_do_action?(:create_wiki)
13 14
        build_status_object(true)
      else
15
        build_status_object(false, "You are not allowed to write to this project's wiki.")
16
      end
17 18 19
    end
  end
end