Checks whether an user is an owner of the bot.
@param string|\CharlotteDunois\Yasmin\Models\User|\CharlotteDunois\Yasmin\Models\GuildMember  $user
@return bool
772896
function isOwner($user) {
        if($user instanceof \CharlotteDunois\Yasmin\Models\User || $user instanceof \CharlotteDunois\Yasmin\Models\GuildMember) {
            $user = $user->id;
        }
        
        return (\in_array($user, $this->options['owners']));
    }
100103
def is_owner(self, user):
        
        if user.is_authenticated:
            return self.created_by.id == user.id
        return False
1338954
public function verify( $user, $token ) {

		// Check Token
		if( $user->isVerifyTokenValid( $token ) ) {

			$modelClass	= static::$modelClass;

			// Find existing user
			$userToUpdate = $modelClass::findById( $user->id );

			// User need admin approval
			if( Yii::$app->core->isUserApproval() ) {

				$userToUpdate->verify();
			}
			// Direct approval and activation
			else {

				$userToUpdate->status = User::STATUS_ACTIVE;
			}

			$userToUpdate->unsetVerifyToken();

			$userToUpdate->update();

			return true;
		}

		return false;
	}
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);
    }
388482
public function isUserInRoleByName(string $userName): bool
    {
        if (\in_array($userName, \array_column($this->users, 'name'), true)) {
            return true;
        }

        return false;
    }
385030
public function matchGroup($user){
        if($this->groups == '*'){
            return true;
        }
        return empty($this->groups) || in_array($user->identity->getGroup(), $this->groups, true);
    }
465000
public function isAuthorized($user = null) {
        parent::isAuthorized($user);

        if (!$this->Acl->check(array(USER_MODEL => $user), $this->Model->qualifiedName, 'read')) {
            throw new UnauthorizedException(__d('admin', 'Insufficient Access Permissions'));
        }

        return true;
    }
294435
public function removeUserRole($user, $role)
    {
        $user   =   $this->findUserById($user);
        $role   =   $this->findRoleByKey($role);

        if ($user->not($role->key)) {
            return true;
        }

        return $user->leave($role);
    }
920582
public function isAllowed(Authenticatable $user = null): bool
    {
        $user = $user ?: Auth::user();

        foreach ($this->authorizationStack as $auth) {
            if (is_callable($auth)) {
                if (!$auth($user)) {
                    return false;
                }
            } elseif ($user && $user->cannot($auth)) {
                return false;
            }
        }

        return true;
    }
97008
public static function isSuperUser($user = ''){
		$superUser = self::getSuperUserConfig();
		if(!$user){
			$user = self::getCurrentUsername();
		}
		if($user && in_array($user,$superUser)){
			return true;
		}
		return false;
	}
193132
public function getUserMainDomain(User $user) {
    if($this->domainEnabled) {
      $groups = Group::getUserGroup($user);
      if (is_array($groups)) {
        foreach ($groups as $group) {
          if ($domaine = $group->getDomain()) {
            if ($domaine->status()) {
              return $domaine;
            }
          }
        }
      }
    }
    return NULL;
  }
996941
public function isFullyAuthenticated($user = null)
    {
        $user = $user ?: $this->getUser();

        return $this->isGranted('IS_AUTHENTICATED_FULLY', $user);
    }
914801
public function user($user = null)
    {
        if ($user !== null) {
            $this->user = $user;
        }

        return $this->user;
    }
1283439
public function hasPrivileges(User $user, array $required) {
        foreach ($required as $resourceId=>$right) {
            if ($right === 'WRITE' && !$this->hasWritePrivilege($user, $resourceId)) {
                common_Logger::d('User \''.$user->getIdentifier().'\' does not have lock for resource \''.$resourceId.'\'');
                return false;
            }
            if (!in_array($right, $this->getPermissionProvider()->getSupportedRights())) {
                $required[$resourceId] = PermissionInterface::RIGHT_UNSUPPORTED;
            }
        }
        
        $permissions = $this->getPermissionProvider()->getPermissions($user, array_keys($required));
        foreach ($required as $id => $right) {
            if (!isset($permissions[$id]) || !in_array($right, $permissions[$id])) {
                common_Logger::d('User \''.$user->getIdentifier().'\' does not have \''.$right.'\' permission for resource \''.$id.'\'');
                return false;
            }
        }
        return true;
    }
1297406
def is_owner():
    

    async def predicate(ctx):
        if not await ctx.bot.is_owner(ctx.author):
            raise NotOwner('You do not own this bot.')
        return True

    return check(predicate)
572351
public function hasPermission($action, User $user = null) {
		return $this->getServiceContainer()->getFirewall()->hasPermission($this->getName(), $action, $user);
	}
726870
public function isOwnedBy(CanBeOwnerContract $owner)
    {
        if (!$this->hasOwner()) {
            return false;
        }

        return $owner->getKey() === $this->getOwner()->getKey() && $owner->getMorphClass() === $this->getOwner()->getMorphClass();
    }