/**
* Build action.
*
* @param string $type
* @trows BadRequestException
* @return \Cake\Network\Response|null
*/
public function build($type = 'synchronize')
{
if (!Arr::in($type, $this->_buildTypes)) {
throw new BadRequestException(__d('community', 'Unable to find build type "{0}"', $type));
}
$AclExtras = new AclExtras();
$AclExtras->startup($this);
if ($type == 'synchronize') {
$AclExtras->acoSync();
} else {
$AclExtras->acoUpdate();
}
return $this->redirect(['action' => 'permissions']);
}