@mamoorali295/rbac
Version:
Complete RBAC (Role-Based Access Control) system for Node.js with Express middleware, NestJS integration, GraphQL support, MongoDB & PostgreSQL support, modern admin dashboard, TypeScript support, and dynamic permission management
39 lines (38 loc) • 1.02 kB
TypeScript
import { GraphQLSchema } from 'graphql';
export interface RegisterUserDirectiveArgs {
userIdField?: string;
nameField?: string;
emailField?: string;
}
/**
* GraphQL directive transformer for automatically registering users in the RBAC system.
* Automatically assigns default role if configured and calls registration hooks.
*
* @example
* ```graphql
* type Mutation {
* # Default field mapping (id -> user_id, name -> name, email -> email)
* createUser(input: CreateUserInput): User @registerUser
*
* # Custom field mapping
* signUp(data: SignUpInput): User @registerUser(
* userIdField: "userId",
* nameField: "fullName",
* emailField: "emailAddress"
* )
* }
*
* input CreateUserInput {
* id: ID!
* name: String
* email: String
* }
*
* input SignUpInput {
* userId: ID!
* fullName: String
* emailAddress: String
* }
* ```
*/
export declare function registerUserDirectiveTransformer(schema: GraphQLSchema, directiveName?: string): GraphQLSchema;