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-09-17 16:41:28 +08:00
|
|
|
TASKS_MANAGE
|
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-09-17 16:41:28 +08:00
|
|
|
TASKS_CREATE
|
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
|
2021-09-14 17:08:35 +08:00
|
|
|
UPDATE_START_DATE
|
|
|
|
UPDATE_DUE_DATE
|
|
|
|
UPDATE_NOTES
|
|
|
|
TAGS_MANAGE
|
|
|
|
STEPS_MANAGE
|
|
|
|
COMMENTS_MANAGE
|
|
|
|
COMMENTS_CREATE
|
|
|
|
REPOSITORY_ROWS_ASSIGN
|
|
|
|
REPOSITORY_ROWS_MANAGE
|
|
|
|
RESULTS_MANAGE
|
|
|
|
RESULTS_DELETE_ARCHIVED
|
|
|
|
PROTOCOL_MANAGE
|
|
|
|
COMPLETE
|
|
|
|
UPDATE_STATUS
|
|
|
|
STEPS_COMPLETE
|
|
|
|
STEPS_UNCOMPLETE
|
|
|
|
STEPS_CHECK
|
|
|
|
STEPS_UNCHECK
|
|
|
|
STEPS_COMMENTS_CREATE
|
|
|
|
STEPS_COMMENTS_DELETE
|
|
|
|
STEPS_COMMENTS_DELETE_OWN
|
|
|
|
STEPS_COMMENTS_UPDATE
|
|
|
|
STEPS_COMMENT_UPDATE_OWN
|
|
|
|
REPOSITORY_ROWS_MANAGE
|
|
|
|
REPOSITORY_ROWS_ASSIGN
|
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
|