public function hasGroupPermission($groupName, $permission)
    {
        if (strpos($groupName, 'admin:') === 0) {
            $groupName = str_replace("admin:", '', $groupName);
        }
        $logins = $this->adminGroupConfiguration->getGroupLogins($groupName);

        if (!empty($logins)) {
            return $this->hasPermission($logins[0], $permission);
        }
        
        // If guest group is unknow it has no permissions.
        if ($groupName == 'guest' && is_null($logins)) {
            return false;
        }

        if (is_null($logins)) {
            throw new UnknownGroupException("'$groupName' admin group does not exist.");
        }

        return false;
    }
public function hasGroupPermission($groupName, $permission)
    {
        if (strpos($groupName, 'admin:') === 0) {
            $groupName = str_replace("admin:", '', $groupName);
        }
        $logins = $this->adminGroupConfiguration->getGroupLogins($groupName);

        if (!empty($logins)) {
            return $this->hasPermission($logins[0], $permission);
        }
        
        // If guest group is unknow it has no permissions.
        if ($groupName == 'guest' && is_null($logins)) {
            return false;
        }

        if (is_null($logins)) {
            throw new UnknownGroupException("'$groupName' admin group does not exist.");
        }

        return false;
    }
public function hasGroupPermission ( $ groupName , $ permission ) { if ( strpos ( $ groupName , 'admin:' ) === 0 ) { $ groupName = str_replace ( "admin:" , '' , $ groupName ) ; } $ logins = $ this -> adminGroupConfiguration -> getGroupLogins ( $ groupName ) ; if ( ! empty ( $ logins ) ) { return $ this -> hasPermission ( $ logins [ 0 ] , $ permission ) ; } // If guest group is unknow it has no permissions. if ( $ groupName == 'guest' && is_null ( $ logins ) ) { return false ; } if ( is_null ( $ logins ) ) { throw new UnknownGroupException ( "'$groupName' admin group does not exist." ) ; } return false ; }
Check if a group has a certain permission or not.

@param string $groupName  The name of the group to check permissions for.
@param string $permission The permission to check for.

@return bool
@throws UnknownGroupException Thrown when group isn't an admin group.
Check if a group has a certain permission or not .