supertokens-node
    Preparing search index...

    Type Alias RecipeInterface

    type RecipeInterface = {
        addRoleToUser: (
            input: {
                role: string;
                tenantId: string;
                userContext: UserContext;
                userId: string;
            },
        ) => Promise<
            | { didUserAlreadyHaveRole: boolean; status: "OK" }
            | { status: "UNKNOWN_ROLE_ERROR" },
        >;
        createNewRoleOrAddPermissions: (
            input: {
                permissions: string[];
                role: string;
                userContext: UserContext;
            },
        ) => Promise<{ createdNewRole: boolean; status: "OK" }>;
        deleteRole: (
            input: { role: string; userContext: UserContext },
        ) => Promise<{ didRoleExist: boolean; status: "OK" }>;
        getAllRoles: (
            input: { userContext: UserContext },
        ) => Promise<{ roles: string[]; status: "OK" }>;
        getPermissionsForRole: (
            input: { role: string; userContext: UserContext },
        ) => Promise<
            | { permissions: string[]; status: "OK" }
            | { status: "UNKNOWN_ROLE_ERROR" },
        >;
        getRolesForUser: (
            input: { tenantId: string; userContext: UserContext; userId: string },
        ) => Promise<{ roles: string[]; status: "OK" }>;
        getRolesThatHavePermission: (
            input: { permission: string; userContext: UserContext },
        ) => Promise<{ roles: string[]; status: "OK" }>;
        getUsersThatHaveRole: (
            input: { role: string; tenantId: string; userContext: UserContext },
        ) => Promise<
            { status: "OK"; users: string[] }
            | { status: "UNKNOWN_ROLE_ERROR" },
        >;
        removePermissionsFromRole: (
            input: {
                permissions: string[];
                role: string;
                userContext: UserContext;
            },
        ) => Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>;
        removeUserRole: (
            input: {
                role: string;
                tenantId: string;
                userContext: UserContext;
                userId: string;
            },
        ) => Promise<
            | { didUserHaveRole: boolean; status: "OK" }
            | { status: "UNKNOWN_ROLE_ERROR" },
        >;
    }
    Index

    Properties

    addRoleToUser: (
        input: {
            role: string;
            tenantId: string;
            userContext: UserContext;
            userId: string;
        },
    ) => Promise<
        | { didUserAlreadyHaveRole: boolean; status: "OK" }
        | { status: "UNKNOWN_ROLE_ERROR" },
    >
    createNewRoleOrAddPermissions: (
        input: { permissions: string[]; role: string; userContext: UserContext },
    ) => Promise<{ createdNewRole: boolean; status: "OK" }>
    deleteRole: (
        input: { role: string; userContext: UserContext },
    ) => Promise<{ didRoleExist: boolean; status: "OK" }>
    getAllRoles: (
        input: { userContext: UserContext },
    ) => Promise<{ roles: string[]; status: "OK" }>
    getPermissionsForRole: (
        input: { role: string; userContext: UserContext },
    ) => Promise<
        | { permissions: string[]; status: "OK" }
        | { status: "UNKNOWN_ROLE_ERROR" },
    >
    getRolesForUser: (
        input: { tenantId: string; userContext: UserContext; userId: string },
    ) => Promise<{ roles: string[]; status: "OK" }>
    getRolesThatHavePermission: (
        input: { permission: string; userContext: UserContext },
    ) => Promise<{ roles: string[]; status: "OK" }>
    getUsersThatHaveRole: (
        input: { role: string; tenantId: string; userContext: UserContext },
    ) => Promise<
        { status: "OK"; users: string[] }
        | { status: "UNKNOWN_ROLE_ERROR" },
    >
    removePermissionsFromRole: (
        input: { permissions: string[]; role: string; userContext: UserContext },
    ) => Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
    removeUserRole: (
        input: {
            role: string;
            tenantId: string;
            userContext: UserContext;
            userId: string;
        },
    ) => Promise<
        | { didUserHaveRole: boolean; status: "OK" }
        | { status: "UNKNOWN_ROLE_ERROR" },
    >