Gets the roles

@param IContainer $container The IoC container
@return IRoles The roles
551264
protected function getRoles(IContainer $container) : IRoles
    {
        $roleRepository = $this->getRoleRepository($container);
        $roleMembershipRepository = $this->getRoleMembershipRepository($container);
        $container->bindInstance(IRoleRepository::class, $roleRepository);
        $container->bindInstance(IRoleMembershipRepository::class, $roleMembershipRepository);

        return new Roles($roleRepository, $roleMembershipRepository);
    }
1025512
public function getRoleChildren($role) {
        $children = array();
        if (Zend_Registry::isRegistered('Zend_Acl')) {
            $acl = Zend_Registry::get('Zend_Acl');
            $roles = $acl->getRoles();

            foreach ($roles as $potentialChild) {
                if ($acl->inheritsRole($potentialChild, $role)) {
                    $children[] = $potentialChild;
                }
            }
        }
        return $children;
    }
1031162
public function iconMenu(\Zend_Navigation_Container $container = null)
    {
        if (null !== $container) {
            $this->setContainer($container);
        }

        return $this;
    }
88279
public function provideBusinessLayerDependencies(Container $container)
    {
        $container[self::FILESYSTEM_PLUGINS] = function () {
            return $this->getFilesystemPlugins();
        };

        return parent::provideBusinessLayerDependencies($container);
    }
987611
def get_roles(server_context, container_path=None):
    
    url = server_context.build_url(security_controller, 'getRoles.api', container_path=container_path)
    return server_context.make_request(url, None)
716504
public function getRoles()
    {
        $roles = parent::getRoles();

        foreach ($this->getUserRoles() as $userRole) {
            /* @var UserRole $userRole */
            $roles[] = $userRole->getRole()->getIdentifier();
        }

        return $roles;
    }
790478
public function getAdminToolsByRoles(array $roles)
    {
        $disabled = $this->container->get('claroline.config.platform_config_handler')->getParameter('security.disabled_admin_tools');
        $tools = $this->om->getRepository('Claroline\CoreBundle\Entity\Tool\AdminTool')->findByRoles($roles);
        $allowed = [];

        foreach ($tools as $tool) {
            if (!in_array($tool->getName(), $disabled)) {
                $allowed[] = $tool;
            }
        }

        return $allowed;
    }
445554
public function getRole($role)
    {
        if (!$this->hasRole($role)) {
            throw new ConfigurationException(sprintf('Role "%s" does not exist.', $role));
        }

        return $this->roles[$role];
    }
811629
protected function getEventDispatcher(IContainer $container) : IEventDispatcher
    {
        $eventRegistry = new EventRegistry();

        foreach ($this->getEventListenerConfig() as $eventName => $listeners) {
            foreach ((array)$listeners as $listener) {
                $eventRegistry->registerListener($eventName, $this->getEventListenerCallback($listener, $container));
            }
        }

        return new SynchronousEventDispatcher($eventRegistry);
    }
1075363
public function getRole($identifier)
    {
        $role = null;
        try {
            $role = $this->roleService->loadRoleByIdentifier($identifier);
        } catch (ApiExceptions\NotFoundException $e) {
            // Role not found, do nothing, returns null
        }

        return $role;
    }
994685
private function getConfigFromContainer(ContainerInterface $container)
    {
        if (! $container->has('config')) {
            return [];
        }

        $config = $container->get('config');

        if (! isset($config['zf-mvc-auth']['authorization'])) {
            return [];
        }

        return $config['zf-mvc-auth']['authorization'];
    }
1000382
public static function getInstance(DIContainer $container = null)
	{
		static $instance = null;

		if ( null === $instance ) {
			$instance = new static($container);
		}

		return $instance;
	}
957884
protected function getRoleSets()
    {
        return Util::getRoleSets($this->getUsername(), new String($this->lookupName), new String($this->rolesQuery), $this);
    }
1038069
protected function getRoles() {
        if (!$this->_roles) {
            $this->_roles = new RoleList($this->version, $this->solution['sid']);
        }

        return $this->_roles;
    }
977680
public function get($role)
    {
        if (is_scalar($role)) {
            $role = new Role($role);
        } elseif (!$role instanceof Role) {
            throw new \InvalidArgumentException('$role is expected to be of type string or Gobline\Acl\Role');
        }

        $roleName = $role->getName();

        if (!$this->has($role)) {
            throw new \InvalidArgumentException('Role "'.$roleName.'" not found');
        }

        return $this->roles[$roleName];
    }
569749
public function getRolePermissions(Role $role)
    {
        $key = $this->getRoleKey($role);

        // If we've saved the caller permissions we don't need to fetch them again.
        if (array_key_exists($key, $this->rolePermissions)) {
            return $this->rolePermissions[$key];
        }

        $results = $this->getTable()->where('role', $role->getRoleName())->get()->toArray();

        return $this->rolePermissions[$key] = PermissionFactory::createFromData($results);
    }
1069773
function roles()
    {
        $groups = $this->attribute( 'groups' );
        $groups[] = $this->attribute( 'contentobject_id' );
        return eZRole::fetchByUser( $groups );
    }