diff --git a/app/Constants.php b/app/Constants.php
index d5d88a153b95..8ed02d2f1332 100644
--- a/app/Constants.php
+++ b/app/Constants.php
@@ -49,20 +49,20 @@ if (! defined('APP_NAME')) {
define('ENTITY_PROPOSAL_INVITATION', 'proposal_invitation');
$permissionEntities = [
- ENTITY_PROPOSAL,
- ENTITY_EXPENSE,
- ENTITY_PROJECT,
- ENTITY_VENDOR,
- ENTITY_PRODUCT,
- ENTITY_TASK,
- ENTITY_QUOTE,
- ENTITY_CREDIT,
- ENTITY_PAYMENT,
- ENTITY_CONTACT,
- ENTITY_INVOICE,
ENTITY_CLIENT,
- ENTITY_RECURRING_INVOICE,
+ //ENTITY_CONTACT,
+ ENTITY_CREDIT,
+ ENTITY_EXPENSE,
+ ENTITY_INVOICE,
+ ENTITY_PAYMENT,
+ ENTITY_PRODUCT,
+ ENTITY_PROJECT,
+ ENTITY_PROPOSAL,
+ ENTITY_QUOTE,
'reports',
+ ENTITY_TASK,
+ ENTITY_VENDOR,
+ ENTITY_RECURRING_INVOICE,
];
define('PERMISSION_ENTITIES', json_encode($permissionEntities));
diff --git a/app/Policies/GenericEntityPolicy.php b/app/Policies/GenericEntityPolicy.php
index 24cfad36178d..c8a7750bbecf 100644
--- a/app/Policies/GenericEntityPolicy.php
+++ b/app/Policies/GenericEntityPolicy.php
@@ -81,6 +81,37 @@ class GenericEntityPolicy
return false;
}
+ /**
+ * @param User $user
+ * @param $item - entity name or object
+ *
+ * @return bool
+ */
+
+ public static function edit(User $user, $item)
+ {
+ if (! static::checkModuleEnabled($user, $item))
+ return false;
+
+
+ $entityType = is_string($item) ? $item : $item->getEntityType();
+ return $user->hasPermission('edit_' . $entityType) || $user->owns($item);
+ }
+
+ /**
+ * @param User $user
+ * @param $item - entity name or object
+ * @return bool
+ */
+
+ private static function checkModuleEnabled(User $user, $item)
+ {
+ $entityType = is_string($item) ? $item : $item->getEntityType();
+ return $user->account->isModuleEnabled($entityType);
+ }
+
+
+
private static function className($entityType)
{
if (! Utils::isNinjaProd()) {
diff --git a/database/seeds/CountriesSeeder.php b/database/seeds/CountriesSeeder.php
index 426deec1a2da..7e7cf5bf924a 100644
--- a/database/seeds/CountriesSeeder.php
+++ b/database/seeds/CountriesSeeder.php
@@ -162,6 +162,9 @@ class CountriesSeeder extends Seeder
'thousand_separator' => ',',
'decimal_separator' => '.',
],
+ 'SR' => [ // Suriname
+ 'swap_currency_symbol' => true,
+ ],
'UY' => [
'swap_postal_code' => true,
],
diff --git a/database/seeds/CurrenciesSeeder.php b/database/seeds/CurrenciesSeeder.php
index 561138fb470e..78fa38d2235a 100644
--- a/database/seeds/CurrenciesSeeder.php
+++ b/database/seeds/CurrenciesSeeder.php
@@ -85,6 +85,7 @@ class CurrenciesSeeder extends Seeder
['name' => 'Georgian Lari', 'code' => 'GEL', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => ','],
['name' => 'Qatari Riyal', 'code' => 'QAR', 'symbol' => 'QR', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Honduran Lempira', 'code' => 'HNL', 'symbol' => 'L', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
+ ['name' => 'Surinamese Dollar', 'code' => 'SRD', 'symbol' => 'SRD', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
];
foreach ($currencies as $currency) {
diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php
index 63790dddd6cf..8996450aafec 100644
--- a/resources/lang/en/texts.php
+++ b/resources/lang/en/texts.php
@@ -2410,6 +2410,7 @@ $LANG = array(
'currency_georgian_lari' => 'Georgian Lari',
'currency_qatari_riyal' => 'Qatari Riyal',
'currency_honduran_lempira' => 'Honduran Lempira',
+ 'currency_surinamese_dollar' => 'Surinamese Dollar',
'review_app_help' => 'We hope you\'re enjoying using the app.
If you\'d consider :link we\'d greatly appreciate it!',
'writing_a_review' => 'writing a review',
diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php
index c7f94c012152..b532168f77ab 100644
--- a/resources/views/users/edit.blade.php
+++ b/resources/views/users/edit.blade.php
@@ -102,6 +102,9 @@
->check(is_array($permissions) && in_array('edit_' . $permissionEntity, $permissions, FALSE) ? true : false) !!}
@endforeach
+