Skip to content

Commit

Permalink
PR(FEEDBACK): Do the PR review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzadlone committed Dec 5, 2024
1 parent 5e7febe commit f18c151
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_GQL_ManagerCanR

Description: "Test acp, owner makes a manager that gives itself read and write access",

SupportedMutationTypes: immutable.Some([]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used so test that separately.
testUtils.GQLRequestMutationType,
}),
SupportedMutationTypes: immutable.Some(
[]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used (only for update requests),
// so test that separately.
testUtils.GQLRequestMutationType,
},
),

Actions: []any{
testUtils.AddPolicy{
Expand Down Expand Up @@ -274,10 +277,13 @@ func TestACP_OwnerMakesManagerButManagerCanNotPerformOperations_GQL_ManagerCantR

Description: "Test acp, owner makes a manager, manager can't read or write",

SupportedMutationTypes: immutable.Some([]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used so test that separately.
testUtils.GQLRequestMutationType,
}),
SupportedMutationTypes: immutable.Some(
[]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used (only for update requests),
// so test that separately.
testUtils.GQLRequestMutationType,
},
),

Actions: []any{
testUtils.AddPolicy{
Expand Down Expand Up @@ -442,10 +448,13 @@ func TestACP_ManagerAddsRelationshipWithRelationItDoesNotManageAccordingToPolicy

Description: "Test acp, manager adds relationship with relation it does not manage according to policy, error",

SupportedMutationTypes: immutable.Some([]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used so test that separately.
testUtils.GQLRequestMutationType,
}),
SupportedMutationTypes: immutable.Some(
[]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used (only for update requests),
// so test that separately.
testUtils.GQLRequestMutationType,
},
),

Actions: []any{
testUtils.AddPolicy{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_ManagerCanReadA
Description: "Test acp, owner makes a manager that gives itself read and write access",

SupportedMutationTypes: immutable.Some([]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used with gql (only for update requests),
testUtils.CollectionNamedMutationType,
testUtils.CollectionSaveMutationType,
}),
Expand Down Expand Up @@ -850,6 +851,7 @@ func TestACP_ManagerAddsRelationshipWithRelationItDoesNotManageAccordingToPolicy
Description: "Test acp, manager adds relationship with relation it does not manage according to policy, error",

SupportedMutationTypes: immutable.Some([]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used with gql (only for update requests),
testUtils.CollectionNamedMutationType,
testUtils.CollectionSaveMutationType,
}),
Expand Down Expand Up @@ -1018,6 +1020,7 @@ func TestACP_OwnerMakesManagerButManagerCanNotPerformOperations_ManagerCantReadO
Description: "Test acp, owner makes a manager, manager can't read or write",

SupportedMutationTypes: immutable.Some([]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used with gql (only for update requests),
testUtils.CollectionNamedMutationType,
testUtils.CollectionSaveMutationType,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorWithoutExplicitReadPerm_GQ

Description: "Test acp, owner gives write(update) access without explicit read permission, can still update",

SupportedMutationTypes: immutable.Some([]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used so test that separately.
testUtils.GQLRequestMutationType,
}),
SupportedMutationTypes: immutable.Some(
[]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used (only for update requests),
// so test that separately.
testUtils.GQLRequestMutationType,
},
),

Actions: []any{
testUtils.AddPolicy{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorWithoutExplicitReadPerm_Ot
Description: "Test acp, owner gives write(update) access without explicit read permission, can still update",

SupportedMutationTypes: immutable.Some([]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used with gql (only for update requests),
testUtils.CollectionNamedMutationType,
testUtils.CollectionSaveMutationType,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_GQL_OtherActorCanReadButNotU

Description: "Test acp, owner gives read access to another actor, but the other actor can't update",

SupportedMutationTypes: immutable.Some([]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used so test that separately.
testUtils.GQLRequestMutationType,
}),
SupportedMutationTypes: immutable.Some(
[]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used (only for update requests),
// so test that separately.
testUtils.GQLRequestMutationType,
},
),

Actions: []any{
testUtils.AddPolicy{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ func TestACP_OwnerGivesOnlyReadAccessToAllActors_GQL_AllActorsCanReadButNotUpdat

SupportedMutationTypes: immutable.Some(
[]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used so test that separately.
// GQL mutation will return no error when wrong identity is used (only for update requests),
// so test that separately.
testUtils.GQLRequestMutationType,
},
),
Expand Down Expand Up @@ -258,7 +259,8 @@ func TestACP_OwnerGivesOnlyReadAccessToAllActors_GQL_CanReadEvenWithoutIdentityB

SupportedMutationTypes: immutable.Some(
[]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used so test that separately.
// GQL mutation will return no error when wrong identity is used (only for update requests),
// so test that separately.
testUtils.GQLRequestMutationType,
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAllActors_AllActorsCanReadButNotUpdateOrD

SupportedMutationTypes: immutable.Some(
[]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used with gql (only for update requests),
testUtils.CollectionNamedMutationType,
testUtils.CollectionSaveMutationType,
},
Expand Down Expand Up @@ -258,6 +259,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAllActors_CanReadEvenWithoutIdentityButNo

SupportedMutationTypes: immutable.Some(
[]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used with gql (only for update requests),
testUtils.CollectionNamedMutationType,
testUtils.CollectionSaveMutationType,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorTwice_ShowThatTheRelations
Description: "Test acp, owner gives write(update) access to another actor twice, no-op",

SupportedMutationTypes: immutable.Some([]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used with gql (only for update requests),
testUtils.CollectionNamedMutationType,
testUtils.CollectionSaveMutationType,
}),
Expand Down Expand Up @@ -185,6 +186,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_OtherActorCanUpdate(t *te
Description: "Test acp, owner gives write(update) access to another actor",

SupportedMutationTypes: immutable.Some([]testUtils.MutationType{
// GQL mutation will return no error when wrong identity is used with gql (only for update requests),
testUtils.CollectionNamedMutationType,
testUtils.CollectionSaveMutationType,
}),
Expand Down

0 comments on commit f18c151

Please sign in to comment.