@@ -429,15 +429,15 @@ func (engine *SubjectFilter) subjectFilterDirectRelation(
429429 // NewContextualRelationships() creates a ContextualRelationships instance from tuples in the request.
430430 // QueryRelationships() then uses the filter to find and return matching relationships.
431431 var cti * database.TupleIterator
432- cti , err = storageContext .NewContextualTuples (request .GetContext ().GetTuples ()... ).QueryRelationships (filter , database .NewCursorPagination ())
432+ cti , err = storageContext .NewContextualTuples (request .GetContext ().GetTuples ()... ).QueryRelationships (filter , database .NewCursorPagination (database . Cursor ( request . GetContinuousToken ()), database . Sort ( "subject_id" ) ))
433433 if err != nil {
434434 return subjectFilterEmpty (), err
435435 }
436436
437437 // Query the relationships for the entity in the request.
438438 // TupleFilter helps in filtering out the relationships for a specific entity and a permission.
439439 var rit * database.TupleIterator
440- rit , err = engine .dataReader .QueryRelationships (ctx , request .GetTenantId (), filter , request .GetMetadata ().GetSnapToken (), database .NewCursorPagination ())
440+ rit , err = engine .dataReader .QueryRelationships (ctx , request .GetTenantId (), filter , request .GetMetadata ().GetSnapToken (), database .NewCursorPagination (database . Cursor ( request . GetContinuousToken ()), database . Sort ( "subject_id" ) ))
441441 if err != nil {
442442 return subjectFilterEmpty (), err
443443 }
@@ -517,10 +517,10 @@ func (engine *SubjectFilter) subjectFilterDirectRelation(
517517// setChild generates a SubjectFilterFunction by applying a SubjectFilterCombiner
518518// to a set of child permission lookups, given a request and a list of Child objects.
519519func (engine * SubjectFilter ) setChild (
520- ctx context.Context , // The context for carrying out the operation
520+ ctx context.Context , // The context for carrying out the operation
521521 request * base.PermissionLookupSubjectRequest , // The request containing parameters for lookup
522- children []* base.Child , // The children of a particular node in the permission schema
523- combiner SubjectFilterCombiner , // A function to combine the results from multiple lookup functions
522+ children []* base.Child , // The children of a particular node in the permission schema
523+ combiner SubjectFilterCombiner , // A function to combine the results from multiple lookup functions
524524) SubjectFilterFunction {
525525 var functions []SubjectFilterFunction // Array of functions to store lookup functions for each child
526526
@@ -795,13 +795,7 @@ func subjectFilterIntersection(ctx context.Context, functions []SubjectFilterFun
795795 // If wildcard was encountered, we exclude the IDs in `excludedIds`
796796 if encounteredWildcard {
797797 if len (commonIds ) == 0 {
798- // No specific common IDs were found, so all are included except exclusions
799- finalRes := []string {ALL }
800- if len (excludedIds ) > 0 {
801- exclusions := "-" + strings .Join (excludedIds , "," )
802- return []string {finalRes [0 ] + exclusions }, nil
803- }
804- return []string {ALL }, nil
798+ return []string {}, nil
805799 }
806800
807801 // Exclude IDs from commonIds that are in excludedIds
0 commit comments