public function listAction()
    {
        $roleHierarchy = $this->container->getParameter('security.role_hierarchy.roles');

        $roles = [];
        foreach (array_keys($roleHierarchy) as $role) {
            $roles[] = ['id' => $role, 'name' => $role];
        }

        return new JsonResponse($roles);
    }
public function listAction()
    {
        $roleHierarchy = $this->container->getParameter('security.role_hierarchy.roles');

        $roles = [];
        foreach (array_keys($roleHierarchy) as $role) {
            $roles[] = ['id' => $role, 'name' => $role];
        }

        return new JsonResponse($roles);
    }
public function listAction ( ) { $ roleHierarchy = $ this -> container -> getParameter ( 'security.role_hierarchy.roles' ) ; $ roles = [ ] ; foreach ( array_keys ( $ roleHierarchy ) as $ role ) { $ roles [ ] = [ 'id' => $ role , 'name' => $ role ] ; } return new JsonResponse ( $ roles ) ; }
List roles.

@return JsonResponse
@Route("", name="users_roles_list")
@Method("GET")
@ApiDoc(
description="Returns a list of roles"
)
List roles .