Prevent deletion of built-in permission roles

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
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.
Post Reply
skouat
Registered User
Posts: 13
Joined: Tue Mar 01, 2011 11:19 pm

Prevent deletion of built-in permission roles

Post by skouat »

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.

Senky
Extension Customisations
Extension Customisations
Posts: 315
Joined: Thu Jul 16, 2009 4:41 pm

Re: Prevent deletion of built-in permission roles

Post by Senky »

Well, then check for permission existence in your migration :)

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 17
Joined: Thu May 24, 2012 1:54 pm

Re: Prevent deletion of built-in permission roles

Post by kasimi »

I think the migrator should take care of this. If the role doesn't exist, the 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.

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: Prevent deletion of built-in permission roles

Post by brunoais »

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.

Post Reply