-
I've updated Typetta from {
"message": "[Security Policy Middleware] Unauthorized access to restricted fields.",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"securityContext"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"exception": {
"allowedProjection": {
"__typename": true,
"avatarLink": true,
"bannerLink": true,
"createdAt": true,
"updatedAt": true,
"id": true,
"username": true,
"displayName": true,
"projectMembers": true,
"classYear": true,
"roles": true,
"socials": true,
"bio": true,
"eBoard": true
},
"requestedProjection": true,
"unauthorizedProjection": true,
"permissions": [],
"operationDomains": [
{
"id": [
"62c0076811b212adc8f4622f"
]
}
],
"stacktrace": [
"Error: [Security Policy Middleware] Unauthorized access to restricted fields.",
" at before (c:backend\\node_modules\\@twinlogix\\typetta\\lib\\dal\\dao\\middlewares\\securityPolicy\\security.middleware.js:99:27)",
" at InMemoryUserDAO.executeBeforeMiddlewares (c:backend\\node_modules\\@twinlogix\\typetta\\lib\\dal\\dao\\dao.js:533:34)",
" at runMicrotasks (<anonymous>)",
" at processTicksAndRejections (node:internal/process/task_queues:96:5)",
" at async c:backend\\node_modules\\@twinlogix\\typetta\\lib\\dal\\dao\\dao.js:220:35",
" at async InMemoryUserDAO.logOperation (c:backend\\node_modules\\@twinlogix\\typetta\\lib\\dal\\dao\\dao.js:594:28)",
" at async getCompleteSecurityContext (c:backend\\dist\\controllers\\security.controller\\security-context.js:11:24)",
" at async Object.securityContext (c:backend\\dist\\graphql\\auth\\auth.resolvers.js:11:24)"
]
}
}
} Here's the relevant bit of my security policy: user: {
domain: {
userId: 'id',
},
permissions: {
READ_USER_PRIVATE: PERMISSION.READ_ONLY,
},
defaultPermissions: {
read: {
__typename: true,
avatarLink: true,
bannerLink: true,
createdAt: true,
updatedAt: true,
id: true,
username: true,
displayName: true,
projectMembers: true,
classYear: true,
roles: true,
socials: true,
bio: true,
eBoard: true,
},
},
}, I don't understand why |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Changing the EntityManager I used into an unsecured EntityManager fixed the problem for me. However, my code should theoretically run fine with a secured EntityManager. I noticed that the error occurs during an |
Beta Was this translation helpful? Give feedback.
Changing the EntityManager I used into an unsecured EntityManager fixed the problem for me. However, my code should theoretically run fine with a secured EntityManager. I noticed that the error occurs during an
exists
operation. Maybe theexists
operation is incorrectly applying the operation domain?