Serenity: [Proposal] Delete button on entity dialog should be hidden if user does not have Delete permission

Created on 7 Nov 2019  路  7Comments  路  Source: serenity-is/Serenity

Currently if user does not have Delete permission and click on Delete button, it will throw an error message, I think we should hide the button.

Consider Create New/Save/Localization/Clone button as well.

Most helpful comment

Yes, i am also planning to add permission keys to the row, like SomeRow.insertPermission etc, and also generate a per module permission key class in TS, then use such information in a method like getAddPermission(), getDeletePermission() in grid/dialog similar to other methods

All 7 comments

btw consider to update Sergen to generate PermissionKeys for client side (typescript) so we can use it strongly-type, for example:

Q.Authorization.hasPermission(PermissionKeys.Product_Delete)

I am also thinking about this.

Yes, i am also planning to add permission keys to the row, like SomeRow.insertPermission etc, and also generate a per module permission key class in TS, then use such information in a method like getAddPermission(), getDeletePermission() in grid/dialog similar to other methods

Funny enough 2 years after deploying our in-house app I have had this come up three times in the last two weeks by my co-workers.

Ok, first step is done, 867fae09e35e6d66449b142cc17e32644d6004eb

3.9.13 has this implemented.

Many thanks @volkanceylan I tried to upgrade serenity and it works very good
I see that it will disable buttons (not hide it) but it's okay

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stixoffire picture stixoffire  路  3Comments

newyearsoft picture newyearsoft  路  3Comments

ga5tan picture ga5tan  路  3Comments

ahsansolution picture ahsansolution  路  3Comments

GitHubOrim picture GitHubOrim  路  3Comments