Add the new rule to proper views and also in the Asset Transformer

This commit is contained in:
Ivan Nieto Vivanco
2023-07-19 19:52:03 -06:00
parent 705411eb4d
commit ecf522243b
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -101,10 +101,10 @@ class AssetsTransformer
foreach ($asset->model->fieldset->fields as $field) {
if ($field->isFieldDecryptable($asset->{$field->db_column})) {
$decrypted = Helper::gracefulDecrypt($field, $asset->{$field->db_column});
$value = (Gate::allows('superadmin') || Gate::allows('admin')) ? $decrypted : strtoupper(trans('admin/custom_fields/general.encrypted'));
$value = (Gate::allows('assets.view.encrypted_custom_fields')) ? $decrypted : strtoupper(trans('admin/custom_fields/general.encrypted'));
if ($field->format == 'DATE'){
if (Gate::allows('superadmin') || Gate::allows('admin')){
if (Gate::allows('assets.view.encrypted_custom_fields')){
$value = Helper::getFormattedDateObject($value, 'date', false);
} else {
$value = strtoupper(trans('admin/custom_fields/general.encrypted'));