2020-07-29 02:09:49 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module ReadonlyAbilities
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
READONLY_ABILITIES = %i[
|
|
|
|
admin_tag
|
|
|
|
push_code
|
|
|
|
push_to_delete_protected_branch
|
|
|
|
request_access
|
|
|
|
upload_file
|
|
|
|
resolve_note
|
|
|
|
create_merge_request_from
|
|
|
|
create_merge_request_in
|
|
|
|
award_emoji
|
2021-05-14 08:10:58 -04:00
|
|
|
create_incident
|
2020-07-29 02:09:49 -04:00
|
|
|
].freeze
|
|
|
|
|
|
|
|
READONLY_FEATURES = %i[
|
|
|
|
issue
|
2021-03-02 19:10:50 -05:00
|
|
|
issue_board_list
|
2020-07-29 02:09:49 -04:00
|
|
|
merge_request
|
|
|
|
label
|
|
|
|
milestone
|
|
|
|
snippet
|
|
|
|
wiki
|
|
|
|
design
|
|
|
|
note
|
|
|
|
pipeline
|
|
|
|
pipeline_schedule
|
|
|
|
build
|
|
|
|
trigger
|
|
|
|
environment
|
|
|
|
deployment
|
|
|
|
commit_status
|
|
|
|
container_image
|
|
|
|
pages
|
|
|
|
cluster
|
|
|
|
release
|
|
|
|
].freeze
|
|
|
|
|
|
|
|
class_methods do
|
|
|
|
def readonly_abilities
|
|
|
|
READONLY_ABILITIES
|
|
|
|
end
|
|
|
|
|
|
|
|
def readonly_features
|
|
|
|
READONLY_FEATURES
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-05-11 17:10:21 -04:00
|
|
|
ReadonlyAbilities::ClassMethods.prepend_mod_with('ReadonlyAbilities::ClassMethods')
|