Set owner

@param \Haven\SecurityBundle\Entity\Role $owner

@return Page
184927
public function setOwner(\Haven\SecurityBundle\Entity\Role $owner = null) {
        $this->owner = $owner;

        return $this;
    }
939778
public function setOwner($user) {
		if ($this->isLink()) {
			return lchown($this->pathname, $user);
		} else {
			return chown($this->pathname, $user);
		}
	}
103738
public function setActiveRole(\WobbleCode\UserBundle\Document\Role $activeRole)
    {
        $this->activeRole = $activeRole;
        return $this;
    }
899026
public function ownerSite ($value)
	{
		if ($value instanceof Site)
		{
			$this->ownerSiteId($value->id);
		}
		else
		{
			$site = \Craft::$app->getSites()->getSiteByHandle($value);

			if (!$site)
				throw new \Exception('Invalid site handle: ' . $value);

			$this->ownerSiteId($site->id);
		}

		return $this;
	}
1165098
public function assign($role, $userId) {
		
		$userId = $this->getId($userId);
		$entity = \App::$domain->account->login->oneById($userId);
		$assignEntity = $this->forgeEntity([
			'user_id' => $userId,
			'item_name' => $role,
		]);
		$this->insert($assignEntity);
		return AssignmentHelper::forge($userId, $role);
	}
557541
public function setRole( Acl\Role\RoleInterface $role = null )
    {
        $this->role = $role;
        return $this;
    }
121315
public function addRole(\Amulen\UserBundle\Entity\Role $role)
    {
        $this->roles[] = $role;

        return $this;
    }
1354673
public function newAuthorizeRequest($owner, $owner_id, $options)
  {
    return $this->authServer->getGrantType('authorization_code')->newAuthoriseRequest($owner, $owner_id, $options);
  }
649177
public function setUser($user = null)
    {
        $this->user = null;

        if (!$user = $this->internalResolveUser($user)) {
            $this->user = $this->userId = null;
        } else {
            $this->userId = $user->id;
            $this->user = $user;
        }

        return $this;
    }
463254
public function setParent(\Haven\PersonaBundle\Entity\Enterprise $parent = null) {
        $this->parent = $parent;

        return $this;
    }
980439
public function setOwner($user)
    {
        // Note: We need to do a bit of uuid juggling here, because we can't bind the workspaces Owner to a specific
        // implementation, and creating entity relations via interfaces is not supported by Flow. Since the property
        // mapper will call setOwner() with a string parameter (because the property $owner is string), but developers
        // will want to use objects, we need to support both.
        if ($user === null || $user === '') {
            $this->owner = null;
            return;
        }
        if (is_string($user) && preg_match('/^([a-f0-9]){8}-([a-f0-9]){4}-([a-f0-9]){4}-([a-f0-9]){4}-([a-f0-9]){12}$/', $user)) {
            $this->owner = $user;
            return;
        }
        if (!$user instanceof UserInterface) {
            throw new \InvalidArgumentException(sprintf('$user must be an instance of UserInterface, %s given.', gettype($user)), 1447764244);
        }
        $this->owner = $this->persistenceManager->getIdentifierByObject($user);
    }
132664
public function setUser(Authorizable $user)
    {
        $userRoles = $user->getRoles();

        $this->userRoles = $userRoles;

        return $this;
    }
1121908
public function giveUserRole($user, $role)
    {
        $user   =   $this->findUserById($user);
        $role   =   $this->findRoleByKey($role);

        if ($user->is($role->key)) {
            return true;
        }
        
        return $user->join($role);
    }
118403
public function makeSharedAction(Request $request, $owner, $ownerId)
    {
        /** @var BlockManager $manager */
        $manager = $this->get('opifer.content.block_manager');

        $response = new JsonResponse;
        $id       = (int) $request->request->get('id');

        try {
            /** @var PointerBlock $pointerBlock */
            $pointerBlock = $manager->makeBlockShared($id);

            $response->setStatusCode(200);
            $response->setData(['state' => 'created', 'id' => $pointerBlock->getId()]);
            $response->headers->add(['Location' => $this->generateUrl('opifer_content_api_contenteditor_view_block', ['owner' => $owner, 'ownerId' => $ownerId, 'id' => $pointerBlock->getId()])]);
        } catch (\Exception $e) {
            $response->setStatusCode(500, 'Exception');
            $response->setData(['error' => $e->getMessage()]);
        }

        return $response;
    }
747085
public function setParent(\Fulgurio\LightCMSBundle\Entity\Page $parent = null)
    {
        $this->parent = $parent;

        return $this;
    }
758380
public function setOwnerType($ownerType)
    {
        $allowedValues = $this->getOwnerTypeAllowableValues();
        if (!in_array($ownerType, $allowedValues)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'ownerType', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['ownerType'] = $ownerType;

        return $this;
    }
410191
public function setUser(\Haven\SecurityBundle\Entity\User $user = null) {
        $this->user = $user;

        return $this;
    }