Skip to content

Commit

Permalink
[Improvement, EC]: Display read-only asset metadata when granted view…
Browse files Browse the repository at this point in the history
… permission (#524)

* show read only custom metadata when view permission is granted

* use const

* add CHANGELOG.md entry
  • Loading branch information
kingjia90 authored May 22, 2024
1 parent 558c7c2 commit 93643ad
Show file tree
Hide file tree
Showing 9 changed files with 435 additions and 335 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### v1.5.0
- [Assets] Metadata can be now displayed as a read-only tab when the user is granted `view` permissions to the asset.

#### v1.4.0
- [DataObject] Password data type algorithms other than `password_hash` are deprecated since `pimcore/pimcore:^11.2` and will be removed in `pimcore/pimcore:^12`.

Expand Down
2 changes: 1 addition & 1 deletion public/js/pimcore/asset/archive.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pimcore.asset.archive = Class.create(pimcore.asset.asset, {
var items = [];
var user = pimcore.globalmanager.get("user");

if (this.isAllowed("publish")) {
if (this.isAllowed("view") || this.isAllowed("publish")) {
items.push(this.metadata.getLayout());
}
if (this.isAllowed("properties")) {
Expand Down
2 changes: 1 addition & 1 deletion public/js/pimcore/asset/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pimcore.asset.audio = Class.create(pimcore.asset.asset, {

items.push(this.getEditPanel());

if (this.isAllowed("publish")) {
if (this.isAllowed("view") || this.isAllowed("publish")) {
items.push(this.metadata.getLayout());
}
if (this.isAllowed("properties")) {
Expand Down
2 changes: 1 addition & 1 deletion public/js/pimcore/asset/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pimcore.asset.document = Class.create(pimcore.asset.asset, {
items.push(this.getEditPanel());
}

if (this.isAllowed("publish")) {
if (this.isAllowed("view") || this.isAllowed("publish")) {
items.push(this.metadata.getLayout());
}
if (this.isAllowed("properties")) {
Expand Down
2 changes: 1 addition & 1 deletion public/js/pimcore/asset/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pimcore.asset.image = Class.create(pimcore.asset.asset, {
items.push(embeddedMetaDataPanel);
}

if (this.isAllowed("publish")) {
if (this.isAllowed("view") || this.isAllowed("publish")) {
items.push(this.metadata.getLayout());
}
if (this.isAllowed("properties")) {
Expand Down
Loading

0 comments on commit 93643ad

Please sign in to comment.