silverstripe/silverstripe-framework — pull request #2782 by kmayo-ss (2014-01-16 02:51:49+00:00)
Title: BUG: Fixes #730 warn admins removing admin permission from there own profile

This pull request is to resolve CMS Issue 730

https://github.com/silverstripe/silverstripe-cms/issues/730

It works by adding a warning popup when a admin removes the admin option from the DirectGroups listbox on their own profile.
Member::getCMSField has had a check added where if a admin is modifying there own profile a hidden field called removeAdminWarning is added containing there admin groups.
SecurityAdmin.js has been modified so if if any changes are made to DirectGroups it checks the field removeAdminWarning to see if the admin permissions are being removed and if they are a warning is produced.

A unit test has been included for this however this relies on a pull request for the SilverStripe Behat extension which adds 2 new steps.

https://github.com/silverstripe-labs/silverstripe-behat-extension/pull/21