zesty-io / manager-ui

Content platform powering enterprise websites and applications
https://www.zesty.io
Other
39 stars 5 forks source link

User with *Contributor role issue -NO SAVE button in the content view; DELETE button visible #2110

Closed gtllien closed 7 months ago

gtllien commented 1 year ago

Describe the bug A user with Contributor role has NO SAVE button available in the content view, but DELETE button is visible.

As per the documentation, Contributors can create and edit but they cannot publish content. To publish new content, contributors must submit a workflow request to a user with publishing access. Contributors can access media and add files, but they cannot delete files. All roles have access to publishing/unpublishing and deleting content except for the Contributor role.

Expected behavior User with Contributor role can create and edit content so SAVE button is expected to be available in view. User with Contributor role cannot delete content (as per doc) so DELETE button should not be visible in view.

Screenshots image

Reference issue: https://github.com/zesty-io/instances-api/issues/544 https://github.com/zesty-io/instances-api/issues/543

finnar-bin commented 1 year ago

Based on the response from the api, the following permissions are available for the "contributor" role:

{
  delete: true,
  grant: false,
  name: "Contributor",
  publish: false,
  read: true,
  super: false,
  update: true,
}

The delete button is controlled by the delete property which in this case is true while the save button is based off of publish which in this case is false. Hence delete being visible and save is missing. Probably need to update this on BE. Although, we will need confirmation regarding save being tied to the publish property, perhaps @markelmad or @shrunyan can provide more insight to this?

gtllien commented 1 year ago

In addition, a user with *Contributor role though SAVE button is not visible in content view, user can still SAVE the content using shortcut key cmd/ctrl +S. Or when leaving the content unsaved, a prompt will show with option to SAVE. Please see video.

https://github.com/zesty-io/manager-ui/assets/112954373/de7215be-f22a-41db-b278-e8974e1e3dd6