Check if authenticate user has group

@param string $group

@return bool|null return NULL if user is not authenticated
162489
public function hasGroup($group)
    {
        if ($this->user() === null) {
            return null;
        }

        return in_array($group, $this->groups, true);
    }
1319251
protected static function isValidGroupId($group)
    {
        if (empty($group)) {
            echo new \Exception('group('.var_export($group, true).') empty');
            return false;
        }
        return true;
    }
65692
public function isDescendant($group = null) {
    if (is_numeric($group)) {
      $group = Group::factory((int) $group);
    }
    if (!isset($group->guid)) {
      return false;
    }
    // Check to see if the group is a descendant of the given group.
    if (!isset($this->parent)) {
      return false;
    }
    if ($this->parent->is($group)) {
      return true;
    }
    if ($this->parent->isDescendant($group)) {
      return true;
    }
    return false;
  }
822287
protected function checkGroup($group='') {
         if(!empty($group)) {
            $groups = explode(',',$group);
            $_group = array();
            foreach ($groups as $field){
                // 解析成聚合字段
                if(array_key_exists($field,$this->mapFields)){
                    // 需要处理映射字段
                    $field  =   $this->mapFields[$field];
                }                 
                $_group[] = $field;
            }
            $group  =   implode(',',$_group);
         }
        return $group;
    }
781832
public function hasGroupPermissionSelected(Group $group)
    {
        $definition = (new Query())->select("inheritance")->from("cms_nav_permission")->where(['group_id' => $group->id, 'nav_id' => $this->id])->one();
        
        if ($definition) {
            return true;
        }
        
        return false;
    }
816400
public function group(string $group, callable $callback)
    {
        $group = rtrim($group, '/');
        if (!$group) {
            return null;
        }

        $this->group = rtrim($this->group, '/') . $group ;
        $this->middleware->group($this->group);
        $callback($this);
        $this->resetGroup();
    }
1199032
protected function isUserAssignedToGroup($groups)
    {
        $isValid = false;

        $user = $this->getUser();
        foreach ($groups as $group) {
            if ($user->inGroup($group->getId())) {
                $isValid = true;
                break;
            }
        }

        return $isValid;
    }
1109636
public function isAuthenticated($user = null)
    {
        $user = $user ?: $this->getUser();

        return $this->isGranted('IS_AUTHENTICATED_FULLY', $user) || $this->isGranted('IS_AUTHENTICATED_REMEMBERED', $user);
    }
1016478
public function getAdminsByGroup($group)
    {
        if (!isset($this->adminGroups[$group])) {
            throw new \InvalidArgumentException(sprintf('Group "%s" not found in admin pool.', $group));
        }

        $admins = [];

        if (!isset($this->adminGroups[$group]['items'])) {
            return $admins;
        }

        foreach ($this->adminGroups[$group]['items'] as $item) {
            $admins[] = $this->getInstance($item['admin']);
        }

        return $admins;
    }
403938
def _check_required_group(self):
        
        required_group_dn = self.settings.REQUIRE_GROUP

        if required_group_dn is not None:
            if not isinstance(required_group_dn, LDAPGroupQuery):
                required_group_dn = LDAPGroupQuery(required_group_dn)
            result = required_group_dn.resolve(self)
            if not result:
                raise self.AuthenticationFailed(
                    "user does not satisfy AUTH_LDAP_REQUIRE_GROUP"
                )

        return True
808348
def _check_required_group(self):
        
        required_group_dn = self.settings.REQUIRE_GROUP

        if required_group_dn is not None:
            is_member = self._get_groups().is_member_of(required_group_dn)
            if not is_member:
                raise self.AuthenticationFailed("user is not a member of AUTH_LDAP_REQUIRE_GROUP")

        return True
296627
public function delGroup($group) {
    if ($group->inArray((array) $this->groups)) {
      foreach ((array) $this->groups as $key => $curGroup) {
        if ($group->is($curGroup)) {
          unset($this->groups[$key]);
        }
      }
      return $this->groups;
    }
    return true;
  }
408258
public function group($group = null) {
		if ($group) {
			$this->_config['group'] = $group;
			return $this;
		}
		if ($group === false) {
			$this->_config['group'] = null;
			return $this;
		}
		return $this->_config['group'];
	}
1338819
public function inGroup($group = null) {
    if (is_numeric($group)) {
      $group = Group::factory((int) $group);
    }
    if (!isset($group->guid)) {
      return false;
    }
    return ($group->inArray((array) $this->groups) || $group->is($this->group));
  }
395570
protected function getPostType($group)
    {
    	// Receive the config variable where we have whitelisted all models
    	$nikuConfig = config('niku-cms');

    	// Validating if the model exists in the array
    	if(array_key_exists($group, $nikuConfig['config_types'])){

    		// Setting the model class
    		$postTypeModel = new $nikuConfig['config_types'][$group];

    		// Lets validate if the request has got the correct authorizations set
    		if(!$this->authorizations($postTypeModel)){
    			return false;
    		}

    		return $postTypeModel;

    	} else {
    		return false;
    	}
    }
442718
public function hasGroup($key)
    {
        list($namespace, $group) = $this->parseKey($key);

        return $this->loader->exists($group, $namespace);
    }
766855
public function clean($group = null)
	{
		$prefix = $this->options['hash'] . '-cache-' . $group . '-';

		foreach ($this->data as $key => $value)
		{
			if (substr($key, 0, strlen($prefix)) == $prefix)
			{
				unset($this->data[$key]);
			}
		}

		return true;
	}