Adds a role to the list of role names that should be enabled for this feature
@param string $roleName
@return RolloutableInterface $this
971907
public function addRole($roleName)
    {
        if (true === is_string($roleName) && false === in_array($roleName, $this->roles)) {
            $this->roles[] = $roleName;
        }
        return $this;
    }
719116
public function create($roleName)
    {
        if (! is_null($this->findByName($roleName))) {
            // TODO: add translation support
            throw new RoleExistsException('A role with the given name already exists');
        }

        return $role = $this->model->create(['name' => $roleName]);
    }
1296202
public function addRoleByName(string $roleName)
    {
        if (!$this->user) {
            throw new UserRequiredException();
        }

        $this->compileUserRoles();

        if ($this->hasRoleWithName($roleName)) {
            return;
        }

        $role = $this->roleProvider->getRoleWithName($roleName);

        if (!$role) {
            throw new InvalidRoleException($roleName);
        }

        $this->user->addRole($role);
        $this->userRoles[] = $roleName;
        $this->userProvider->update($this->user);
    }
1100152
protected function allows($roles, $resources = null)
    {
        $roles = is_array($roles) ? $roles : [$roles];
        foreach ($roles as $role) {
            if (!$role) {
                continue;
            }
            if (!$this->hasRole($role)) {
                $this->addRole($role, 'LOGGED');
            }
            $this->allow($role, $resources);
        }
        return $this;
    }
1206273
public function add($role)
    {
        $this->bucket[$role] = sprintf("%05d", $this->acl->getRoleLevel($role)) .'-'. $role;
        return $this;
    }
70664
public function is($roleName)
    {
        if (is_array($roleName)) {
            return $this->hasRoles($roleName);
        }

        return $this->hasRole($roleName);
    }
83602
public function addRole(string $role): UserInterface
    {
        $role = mb_strtoupper($role);

        if (!\in_array($role, $this->roles, true)) {
            $this->roles[] = $role;
        }

        return $this;
    }
631288
public function name(string $string): RoleObject {
		$this->role[] = $role = new RoleObject($string);

		return $role;
	}
213066
protected function getRolePermissions($roleName)
    {
        $role = new SimpleRole($roleName);
        $permissions = $this->manager->getDriver()->getRolePermissions($role);
        $collection = new Collection();
        foreach ($permissions as $permission) {
            if ($permission instanceof Restriction) {
                continue;
            }
            $collection->allow($permission->getAction(), $permission->getResourceType(), $permission->getResourceId());
        }
        return $collection;
    }
33018
public function addRole($name)
    {
        $params = [
            'name' => $name,
        ];

        $body = $this->request(self::URI_AUTH_ROLE_ADD, $params);

        return $body;
    }
1105211
public function loadRoleDraftByRoleId($roleId)
    {
        $data = $this->roleGateway->loadRoleDraftByRoleId($roleId);

        if (empty($data)) {
            throw new RoleNotFound($roleId, Role::STATUS_DRAFT);
        }

        $role = $this->mapper->mapRole($data);
        foreach ($role->policies as $policy) {
            $this->limitationConverter->toSPI($policy);
        }

        return $role;
    }
557541
public function setRole( Acl\Role\RoleInterface $role = null )
    {
        $this->role = $role;
        return $this;
    }
323916
public function addRole($name)
    {
        $namespaceUri = $this->dom->lookupNamespaceUri($this->dom->namespaceURI);

        $roleNode = $this->dom->createElementNS($namespaceUri, 'Role');
        $roleNode->setAttribute('name', $name);

        $instancesNode = $this->dom->createElementNS($namespaceUri, 'Instances');
        $instancesNode->setAttribute('count', '2');

        $configurationSettings = $this->dom->createElementNS($namespaceUri, 'ConfigurationSettings');

        $roleNode->appendChild($instancesNode);
        $roleNode->appendChild($configurationSettings);

        $this->dom->documentElement->appendChild($roleNode);

        $this->save();
    }
625957
protected function _addRoles($roles)
    {
        foreach($roles as $role) {
            if (!$this->hasRole($role->getName())) {
                $parents = $role->getParents()->toArray();
                $parentNames = array();
                foreach($parents as $parent) {
                    $parentNames[] = $parent->getName();
                }
                $this->addRole(new Role($role->getName()), $parentNames);
            }
        }

        return $this;
    }
972986
public function removeRole(RoleInterface $role)
    {
        $this->roles->removeElement($role);

        if ($role->hasUser($this) === true)
            $role->removeUser($this);
        
        return $this;
    }
953048
public function allow()
    {
        $roleNames = func_get_args();

        // Flatten array to allow array inputs
        $roleNames = Core::array_flatten($roleNames);

        foreach ($roleNames as $role) {

            if (!in_array($role, $this->allowedRoles)) {
                $this->allowedRoles[] = $role;
            }
        }

        return $this;
    }
1289678
public function addRole($role, array $resources = [])
    {
        if ($role instanceof RoleInterface) {
            $this->roles[$role->getName()] = $role;
        } else {
            $role = new Role($role, $resources);
            $this->roles[$role->getName()] = $role;
        }
    }