You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[4.x]: Delete action for edit product does not look to check permission via the Elements service to determine whether the delete button is shown in the cp
#3285
Closed
samhibberd opened this issue
Sep 29, 2023
· 5 comments
Hooked into Elements service EVENT_AUTHORIZE_DELETE and set$e->authorized = false; Event::on(Elements::class, Elements::EVENT_AUTHORIZE_DELETE, [ElementsHandler::class, 'authorizeDelete']);
Expected behavior
Delete button is hidden from the cp action menu
Actual behavior
Delete button is not hidden from the cp action menu
PS: Works as expected with craft elements eg Entries, Categories
PPS: It does correctly enforce the permission when hitting delete
Craft CMS version
4.5.6.1
Craft Commerce version
4.3.0
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered:
What happened?
Description
Steps to reproduce
Hooked into Elements service
EVENT_AUTHORIZE_DELETE
and set$e->authorized = false;
Event::on(Elements::class, Elements::EVENT_AUTHORIZE_DELETE, [ElementsHandler::class, 'authorizeDelete']);
Expected behavior
Delete button is hidden from the cp action menu
Actual behavior
Delete button is not hidden from the cp action menu
PS: Works as expected with craft elements eg Entries, Categories
PPS: It does correctly enforce the permission when hitting delete
Craft CMS version
4.5.6.1
Craft Commerce version
4.3.0
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: