Skip to content

anonymousminati/frappe-whitelist-functions

Repository files navigation

Frappe Framework Whitelist Functions Documentation

This directory contains comprehensive documentation for all @frappe.whitelist decorated functions in the Frappe Framework. These functions form the public API surface that can be called from client-side JavaScript or external systems.

Overview

The Frappe Framework uses the @frappe.whitelist decorator to expose Python functions as API endpoints. These functions handle various business operations, from basic CRUD operations to complex workflows.

Documentation Structure

The documentation is organized by functional areas:

Security Patterns

All whitelist functions follow these security patterns:

  1. Authentication: Functions require login by default unless allow_guest=True
  2. Permission Validation: Most functions validate user permissions before execution
  3. Input Sanitization: Parameters are validated and sanitized
  4. HTTP Method Restrictions: Some functions restrict allowed HTTP methods

Common Decorators

  • @frappe.whitelist() - Requires authenticated user
  • @frappe.whitelist(allow_guest=True) - Allows unauthenticated access
  • @frappe.whitelist(methods=["POST"]) - Restricts to specific HTTP methods
  • @frappe.validate_and_sanitize_search_inputs - Validates search parameters

Usage Examples

Functions can be called from client-side JavaScript:

// Call a whitelist function
frappe.call({
    method: 'frappe.share.add',
    args: {
        doctype: 'Task',
        name: 'TASK-001',
        user: '[email protected]',
        read: 1,
        write: 1
    }
});

Or via REST API:

curl -X POST "https://yoursite.com/api/method/frappe.share.add" \
  -H "Authorization: token api_key:api_secret" \
  -d "doctype=Task&name=TASK-001&[email protected]&read=1"

Found Functions Summary

Total whitelist functions found: 150+ across 46 files

By Category:

  • Document Management: ~40 functions
  • Printing System: ~25 functions
  • User Interface: ~20 functions
  • File Management: ~15 functions
  • Core Framework: ~15 functions
  • Contact Management: ~10 functions
  • System Administration: ~10 functions
  • Social Features: ~8 functions
  • Utilities: ~5 functions
  • Communication: ~5 functions

See individual documentation files for detailed function specifications, parameters, return values, and usage examples.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published