2021-02-04 21:08:20 +08:00
|
|
|
FactoryBot.define do
|
|
|
|
factory :user_role do
|
2021-05-02 17:22:59 +08:00
|
|
|
factory :owner_role do
|
|
|
|
name { I18n.t('user_roles.predefined.owner') }
|
2023-10-12 22:16:43 +08:00
|
|
|
permissions { PredefinedRoles::OWNER_PERMISSIONS }
|
2021-05-02 17:22:59 +08:00
|
|
|
predefined { true }
|
|
|
|
end
|
|
|
|
|
|
|
|
factory :normal_user_role do
|
|
|
|
name { I18n.t('user_roles.predefined.normal_user') }
|
2021-09-30 17:32:11 +08:00
|
|
|
permissions { PredefinedRoles::NORMAL_USER_PERMISSIONS }
|
2021-05-02 17:22:59 +08:00
|
|
|
predefined { true }
|
|
|
|
end
|
|
|
|
|
|
|
|
factory :technician_role do
|
|
|
|
name { I18n.t('user_roles.predefined.technician') }
|
2021-09-30 17:32:11 +08:00
|
|
|
permissions { PredefinedRoles::TECHNICIAN_PERMISSIONS }
|
2021-05-02 17:22:59 +08:00
|
|
|
predefined { true }
|
|
|
|
end
|
|
|
|
|
|
|
|
factory :viewer_role do
|
|
|
|
name { I18n.t('user_roles.predefined.viewer') }
|
2021-09-30 17:32:11 +08:00
|
|
|
permissions { PredefinedRoles::VIEWER_PERMISSIONS }
|
2021-05-02 17:22:59 +08:00
|
|
|
predefined { true }
|
|
|
|
end
|
2021-02-04 21:08:20 +08:00
|
|
|
end
|
|
|
|
end
|