Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
Translation on resolver #31
Browse files Browse the repository at this point in the history
  • Loading branch information
Tolfx committed Jan 12, 2022
1 parent fccf565 commit 1c8d541
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Database/GraphQL/ResolverAccess.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Resolver } from "graphql-compose";
import Logger from "../../Lib/Logger";
import GetText from "../../Translation/GetText";

export function resolverAdminAccess(resolvers: {
[key: string]: Resolver<any, any, any, any>;
Expand All @@ -9,8 +10,8 @@ export function resolverAdminAccess(resolvers: {
{
resolvers[k] = resolvers[k].wrapResolve(next => async rp =>
{

Logger.graphql(`Checking if user is admin on ${k}`);
Logger.graphql(GetText().graphql.txt_Resolver_Checking_Admin(k));
// Logger.graphql(`Checking if user is admin on ${k}`);

if(!rp.context.isAuth)
throw new Error("Not Authorized");
Expand All @@ -33,7 +34,8 @@ export function resolverUserAccess(resolvers: {
resolvers[k] = resolvers[k].wrapResolve(next => async rp =>
{

Logger.graphql(`Checking if user is user on ${k}`);
Logger.graphql(GetText().graphql.txt_Resolver_Checking_User(k));
// Logger.graphql(`Checking if user is user on ${k}`);

if(!rp.context.isAuth)
throw new Error("Not Authorized");
Expand Down

0 comments on commit 1c8d541

Please sign in to comment.