Hi all !
Although this is rare, admins can delete built-in permissions roles.
As some extension can use them during the installation process, if roles are no longer available, the extension installation failed.
Prevent deletion of built-in permission roles
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.
If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.
If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Re: Prevent deletion of built-in permission roles
Well, then check for permission existence in your migration
Re: Prevent deletion of built-in permission roles
I think the migrator should take care of this. If the role doesn't exist, the
Either that, or don't allow deleting built-in roles in the first place.
permission.permission_set
operation should be skipped, without throwing an error. Admins who delete built-in roles should know that extension won't be able to set default permission values.Either that, or don't allow deleting built-in roles in the first place.
Re: Prevent deletion of built-in permission roles
I'd go for: The admin can always delete any role he chooses to but he should get an extra warning if he is trying to delete a builtin role. If he still decides to delete it, then it was his conscious choice.