Skip to content

Commit

Permalink
GQL-52: Adds identityType to group acl query
Browse files Browse the repository at this point in the history
  • Loading branch information
dmistry1 committed Jun 21, 2024
1 parent af70617 commit b996dc5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 59 deletions.
58 changes: 0 additions & 58 deletions src/resolvers/__tests__/acl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -592,64 +592,6 @@ describe('Acl', () => {
})
})
})

describe('when the acl does not have catalogItemIdentity', () => {
test('returns null for collections', async () => {
nock(/example-cmr/)
.defaultReplyHeaders({
'CMR-Hits': 1,
'CMR-Took': 7,
'CMR-Request-Id': 'abcd-1234-efgh-5678'
})
.get(/access-control\/acls/)
.reply(200, {
items: [
{
acl: {}
}
]
})

const response = await server.executeOperation({
variables: {},
query: `
query GetAcls($params: AclsInput) {
acls(params: $params) {
items {
catalogItemIdentity {
granuleApplicable
collectionApplicable
}
collections {
count
}
}
}
}`

}, {
contextValue
})

const { data, errors } = response.body.singleResult

expect(errors).toBeUndefined()

expect(data).toEqual({
acls: {
items: [
{
catalogItemIdentity: {
collectionApplicable: null,
granuleApplicable: null
},
collections: null
}
]
}
})
})
})
})

describe('acls', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/acl.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default {
},

catalogItemIdentity: async (source) => {
const { catalogItemIdentity = {} } = source
const { catalogItemIdentity } = source

const camelcasedData = camelcaseKeys(catalogItemIdentity, { deep: true })

Expand Down
9 changes: 9 additions & 0 deletions src/types/group.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,16 @@ type Group {
): AclList
}

enum IdentityType {
system
provider
catalog_item
}

input GroupAclsInput {
"Type of the object being controlled."
identityType: IdentityType

"The number of Acls to return."
limit: Int

Expand Down

0 comments on commit b996dc5

Please sign in to comment.