(auth, config)
| 3 | import { createSanitizedError } from '../Error'; |
| 4 | |
| 5 | export function enforceMasterKeyAccess(auth, config) { |
| 6 | if (!auth.isMaster) { |
| 7 | throw createSanitizedError( |
| 8 | Parse.Error.OPERATION_FORBIDDEN, |
| 9 | 'unauthorized: master key is required', |
| 10 | config |
| 11 | ); |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | export function toGraphQLError(error) { |
| 16 | let code, message; |
no test coverage detected