Skip to content

Commit

Permalink
clean up auth checks
Browse files Browse the repository at this point in the history
  • Loading branch information
carrolp committed May 9, 2023
1 parent f821be1 commit 46c5911
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/apollo/resolvers/serviceSubscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,9 @@ const serviceResolvers = {

logger.debug({req_id, user, orgId }, `${queryName} enter`);

await validAuth(me, orgId, ACTIONS.READ, TYPES.SERVICESUBSCRIPTION, queryName, context);

let serviceSubscriptions = [];
try{
await validAuth(me, orgId, ACTIONS.READ, TYPES.SERVICESUBSCRIPTION, queryName, context);
checkComplexity( queryFields );

const query = {org_id: orgId};
Expand Down Expand Up @@ -180,8 +179,6 @@ const serviceResolvers = {
throw new NotFoundError(context.req.t('Cluster with cluster_id "{{clusterId}}" not found', {'clusterId':clusterId}), context);
}

await validAuth(me, cluster.org_id, ACTIONS.CREATE, TYPES.SERVICESUBSCRIPTION, queryName, context);

const total = await models.ServiceSubscription.count({ org_id: orgId });
if (total >= SERVICE_SUBSCRIPTION_LIMITS.MAX_TOTAL) {
throw new RazeeValidationError(context.req.t('Too many subscriptions are registered under {{org_id}}.', { 'org_id': orgId }), context);
Expand Down

0 comments on commit 46c5911

Please sign in to comment.