mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-17 14:46:00 +08:00
f68d724202
* Rework experiment permissions [SCI-6054]
29 lines
1 KiB
Ruby
29 lines
1 KiB
Ruby
FactoryBot.define do
|
|
factory :user_role do
|
|
factory :owner_role do
|
|
name { I18n.t('user_roles.predefined.owner') }
|
|
permissions { ProjectPermissions.constants.map { |const| ProjectPermissions.const_get(const) } +
|
|
ExperimentPermissions.constants.map { |const| ExperimentPermissions.const_get(const) } +
|
|
MyModulePermissions.constants.map { |const| MyModulePermissions.const_get(const) } }
|
|
predefined { true }
|
|
end
|
|
|
|
factory :normal_user_role do
|
|
name { I18n.t('user_roles.predefined.normal_user') }
|
|
permissions { PredefinedRoles::NORMAL_USER_PERMISSIONS }
|
|
predefined { true }
|
|
end
|
|
|
|
factory :technician_role do
|
|
name { I18n.t('user_roles.predefined.technician') }
|
|
permissions { PredefinedRoles::TECHNICIAN_PERMISSIONS }
|
|
predefined { true }
|
|
end
|
|
|
|
factory :viewer_role do
|
|
name { I18n.t('user_roles.predefined.viewer') }
|
|
permissions { PredefinedRoles::VIEWER_PERMISSIONS }
|
|
predefined { true }
|
|
end
|
|
end
|
|
end
|