from graphql import GraphQLError


class UnauthorizedException(GraphQLError):

    def __init__(self):
        super().__init__("Unauthorized", extensions={"code": 401})


class PermissionDeniedException(GraphQLError):

    def __init__(self, permissions: list[str]):
        super().__init__(
            "PermissionDenied", extensions={"permissions": permissions, "code": 403}
        )


class AccessDenied(GraphQLError):
    def __init__(self):
        super().__init__("Access Denied", extensions={"code": 403})
