/** * @return Group */ public function createAdminGroup() { $roles = $this->get('security.roles.provider')->getRoles(); $group = new Group(); foreach ($roles as $role => $value) { if (preg_match('/esperanto/i', $role)) { $group->addRole($role); } } $group->setName('Admin'); return $group; }
public function addEditorGroup() { $roles = $this->container->get('security.roles.provider')->getRoles(); $group = new Group(); foreach ($roles as $role => $value) { if (preg_match('/ROLE_ESPERANTO_USER_ADMIN_USER/i', $role)) { continue; } if (preg_match('/ROLE_ESPERANTO_USER_ADMIN_GROUP/i', $role)) { continue; } if (preg_match('/esperanto/i', $role)) { $group->addRole($role); } } $group->setName('Redakteure'); return $group; }