2021-02-09 17:45:12 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module PermissionExtends
|
|
|
|
module ProjectPermissions
|
|
|
|
%w(
|
|
|
|
READ
|
|
|
|
EXPORT
|
|
|
|
MANAGE
|
|
|
|
ARCHIVE
|
|
|
|
RESTORE
|
|
|
|
CREATE_EXPERIMENTS
|
|
|
|
CREATE_COMMENTS
|
2021-02-18 16:54:53 +08:00
|
|
|
MANAGE_COMMENTS
|
2021-02-09 17:45:12 +08:00
|
|
|
MANAGE_TAGS
|
2021-06-19 23:17:57 +08:00
|
|
|
MANAGE_ACCESS
|
2021-03-01 21:28:21 +08:00
|
|
|
).each { |permission| const_set(permission, "project_#{permission.underscore}") }
|
2021-02-09 17:45:12 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
module ExperimentPermissions
|
|
|
|
%w(
|
|
|
|
READ
|
|
|
|
MANAGE
|
|
|
|
ARCHIVE
|
|
|
|
RESTORE
|
|
|
|
CLONE
|
|
|
|
MOVE
|
2021-02-18 16:54:53 +08:00
|
|
|
CREATE_TASKS
|
2021-06-19 23:17:57 +08:00
|
|
|
MANAGE_ACCESS
|
2021-03-01 21:28:21 +08:00
|
|
|
).each { |permission| const_set(permission, "experiment_#{permission.underscore}") }
|
2021-02-09 17:45:12 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
module MyModulePermissions
|
|
|
|
%w(
|
2021-02-18 16:54:53 +08:00
|
|
|
READ
|
2021-02-09 17:45:12 +08:00
|
|
|
MANAGE
|
|
|
|
ARCHIVE
|
|
|
|
RESTORE
|
|
|
|
MOVE
|
|
|
|
MANAGE_USERS
|
|
|
|
ASSIGN_REPOSITORY_ROWS
|
|
|
|
CHANGE_FLOW_STATUS
|
|
|
|
CREATE_COMMENTS
|
2021-02-18 16:54:53 +08:00
|
|
|
MANAGE_COMMENTS
|
2021-02-09 17:45:12 +08:00
|
|
|
CREATE_REPOSITORY_SNAPSHOT
|
|
|
|
MANAGE_REPOSITORY_SNAPSHOT
|
2021-06-19 23:17:57 +08:00
|
|
|
MANAGE_ACCESS
|
2021-03-01 21:28:21 +08:00
|
|
|
).each { |permission| const_set(permission, "task_#{permission.underscore}") }
|
2021-02-09 17:45:12 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
module RepositoryPermissions
|
|
|
|
%w(
|
|
|
|
READ
|
|
|
|
MANAGE
|
|
|
|
ARCHIVE
|
|
|
|
RESTORE
|
|
|
|
SHARE
|
|
|
|
CREATE_SNAPSHOT
|
|
|
|
DELETE_SNAPSHOT
|
|
|
|
CREATE_ROW
|
|
|
|
UPDATE_ROW
|
|
|
|
DELETE_ROW
|
|
|
|
CREATE_COLUMN
|
|
|
|
UPDATE_COLUMN
|
|
|
|
DELETE_COLUMN
|
2021-03-01 21:28:21 +08:00
|
|
|
).each { |permission| const_set(permission, "inventory_#{permission.underscore}") }
|
2021-02-09 17:45:12 +08:00
|
|
|
end
|
|
|
|
end
|