From 22498b58047812e416446876a45efd032f507bf3 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 10 Nov 2024 15:30:02 +0100 Subject: [PATCH] Expand access rights --- app/Enums/UserRoleEnum.php | 10 ++++++++++ resources/lang/en_US/firefly.php | 2 +- resources/lang/en_US/validation.php | 2 +- resources/views/transactions/show.twig | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/Enums/UserRoleEnum.php b/app/Enums/UserRoleEnum.php index 25dc051383..7504a918f8 100644 --- a/app/Enums/UserRoleEnum.php +++ b/app/Enums/UserRoleEnum.php @@ -30,6 +30,7 @@ namespace FireflyIII\Enums; enum UserRoleEnum: string { // most basic rights, cannot see other members, can see everything else. + // includes reading of metadata case READ_ONLY = 'ro'; // required to even USE the group properly (in this order) @@ -38,6 +39,15 @@ enum UserRoleEnum: string // required to edit, add or change categories/tags/object-groups case MANAGE_META = 'mng_meta'; + // read other objects and things. + case READ_BUDGETS = 'read_budgets'; + case READ_PIGGY_BANKS = 'read_piggies'; + case READ_SUBSCRIPTIONS = 'read_subscriptions'; + case READ_RULES = 'read_rules'; + case READ_RECURRING = 'read_recurring'; + case READ_WEBHOOKS = 'read_webhooks'; + case READ_CURRENCIES = 'read_currencies'; + // manage other financial objects: case MANAGE_BUDGETS = 'mng_budgets'; case MANAGE_PIGGY_BANKS = 'mng_piggies'; diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index df3ac376e6..7fc8a81a05 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -1409,7 +1409,7 @@ return [ 'administration_role_mng_piggies' => 'Manage piggy banks', 'administration_role_mng_subscriptions' => 'Manage subscriptions', 'administration_role_mng_rules' => 'Manage rules', - 'administration_role_mng_recurring' => 'Manage recurring transactions ', + 'administration_role_mng_recurring' => 'Manage recurring transactions', 'administration_role_mng_webhooks' => 'Manage webhooks', 'administration_role_mng_currencies' => 'Manage currencies', 'administration_role_view_reports' => 'View reports', diff --git a/resources/lang/en_US/validation.php b/resources/lang/en_US/validation.php index 8c4ec0ddea..ce9ce7a914 100644 --- a/resources/lang/en_US/validation.php +++ b/resources/lang/en_US/validation.php @@ -63,7 +63,7 @@ return [ 'invalid_selection' => 'Your selection is invalid.', 'belongs_user' => 'This value is linked to an object that does not seem to exist.', 'belongs_user_or_user_group' => 'This value is linked to an object that does not seem to exist in your current financial administration.', - 'no_access_group' => 'The user has no access to this user group.', + 'no_access_group' => 'The user has no access to this administration.', 'no_accepted_roles_defined' => 'No access roles have been defined for this endpoint, access denied.', 'at_least_one_transaction' => 'Need at least one transaction.', 'recurring_transaction_id' => 'Need at least one transaction.', diff --git a/resources/views/transactions/show.twig b/resources/views/transactions/show.twig index 37a03b7114..da6e1da02a 100644 --- a/resources/views/transactions/show.twig +++ b/resources/views/transactions/show.twig @@ -74,7 +74,7 @@ {{ trans('list.date') }} - + {{ first.date.isoFormat(dateTimeFormat) }} {% if(first.date_tz != '') %} ({{ trans('firefly.stored_in_tz', {timezone: first.date_tz }) }})