2021-02-09 17:45:12 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module PermissionExtends
|
|
|
|
module ProjectPermissions
|
|
|
|
%w(
|
|
|
|
READ
|
2021-09-07 17:27:52 +08:00
|
|
|
READ_ARCHIVED
|
2021-02-09 17:45:12 +08:00
|
|
|
MANAGE
|
2021-09-07 17:27:52 +08:00
|
|
|
FOLDERS_READ
|
|
|
|
ACTIVITIES_READ
|
|
|
|
USERS_READ
|
|
|
|
USERS_MANAGE
|
|
|
|
COMMENTS_READ
|
|
|
|
COMMENTS_CREATE
|
|
|
|
COMMENTS_MANAGE
|
|
|
|
EXPERIMENTS_READ
|
|
|
|
EXPERIMENTS_READ_ARCHIVED
|
|
|
|
EXPERIMENTS_CREATE
|
|
|
|
EXPERIMENTS_READ_CANVAS
|
|
|
|
EXPERIMENTS_ACTIVITIES_READ
|
|
|
|
EXPERIMENTS_USERS_READ
|
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
|