Data Builder Visual Reporting API Platform For Perfex CRM Scaled

Mastering Per-Table CRUD Permissions in Perfex CRM

Giving an external mobile app, webhook script, or BI connector an all-or-nothing CRM API key turns a single leaked credential into a full-database breach. Data Builder enforces strict least-privilege governance through two independent layers: granular Staff/Role View Permissions inside Perfex CRM and a Per-Table CRUD Permission Matrix on every SHA-256 API token.

Follow this security playbook to scope Read, Create, Update, and Delete rights per table, isolate sensitive core tables, and audit token activity through Data Builder’s 6-stage middleware pipeline.

Governance LayerAccess Scope ControlledEnforcement Mechanism
API Token MatrixPer-table Read, Create, Update, DeleteStage 5 Scope Verifier in 6-stage API middleware
Token AuthenticationSHA-256 hashed dba_{hex48} keysTiming-safe hash_equals() + optional HMAC
Sensitive Table Guardtblstaff, tblcontacts, tbloptions, tokens6-layer lock preventing unauthorized exposure
Staff & Role ViewsView, Edit, Delete, Manage, ExportRole/user matrix + bulk assign & copy permissions

Step 1: Scope API Tokens with Per-Table CRUD Permissions

Before issuing integration keys, ensure the module is configured properly via the Data Builder installation guide and review our RESTful API and GraphQL security reference. Every API token starts with zero table rights until you explicitly check each table and operation.

  • Open Data Builder > API Tokens, create a purpose-specific token (such as erp-inventory-sync), and copy the dba_... plaintext key immediately because only its SHA-256 hash is stored.
  • In the token’s Per-Table CRUD Permissions matrix, grant only the exact operations needed (for instance, Read only on tblinvoices and Create/Update on custom inventory tables).
  • Add CIDR IP allowlists, CORS domain whitelists, and per-token rate limits so compromised credentials cannot be replayed from unknown hosts.

Step 2: Configure Staff View Permissions and Bulk Templates

Internal analysts rarely need raw API access, yet still require tight view boundaries inside Perfex CRM. Data Builder lets administrators grant View, Edit, or Delete rights per report view and replicate permission sets across departments when deploying JSON report templates.

  • Open View Permissions, select a report view, and assign Role Permissions (such as Sales or Finance) separately from individual Staff Permissions.
  • Use Copy permissions from to clone an audited access template across newly created quarterly views in seconds.
  • Use Bulk Assign Permissions or Revoke All Permissions during staff offboarding to keep access audits clean.

Common Pitfalls and Quick Fixes

  • API returns HTTP 403 on a GraphQL mutation: The token has Read permission on the table but lacks Create, Update, or Delete. Open the token’s CRUD matrix and enable the exact mutation scope.
  • Queries against tblstaff or tbloptions fail: Data Builder enforces a 6-layer Sensitive Table Protection policy blocking tblstaff, tblcontacts, tbloptions, and tbldata_builder_api_tokens. Expose only curated, non-PII views instead.
  • Staff member sees a view marked non-public: Check whether the user’s assigned Role still holds view permission or the view is flagged as Public for all View Builder users.

Frequently Asked Questions

Do per-table CRUD permissions apply equally to REST, GraphQL, and MCP?

Yes. Every REST endpoint, GraphQL query or mutation, and MCP tool request routes through Data Builder’s 6-stage middleware pipeline. Stage 5 (Scope Verifier) validates both table-level CRUD flags and view-level scopes identically before any CodeIgniter query builder call executes against the database.

Which core Perfex tables are restricted by Sensitive Table Protection?

Data Builder applies a strict 6-layer security guard around critical tables including tblstaff, tblcontacts, tbloptions, and tbldata_builder_api_tokens. This architecture protects password hashes, hashed API secrets, and system configuration keys even if an administrator accidentally selects overly broad token scopes.

Can I grant CRUD permissions on third-party Perfex module tables?

Yes. Beyond standard Perfex CRM core database tables, administrators can explicitly whitelist third-party module tables such as SaaS, Accounting, Inventory, Warehouse, Orders, Products, or HRM and assign independent Read, Create, Update, and Delete scopes per API token for external integrations.

How are failed permission checks formatted in API responses?

Unauthorized table, view, or HTTP method calls return structured RFC 9457 Problem Details JSON (application/problem+json) with standard HTTP 403 status codes and OWASP security headers, ensuring client SDKs and automation workflows parse access errors predictably without leaking SQL or schema internals.


Comments

Leave a Reply

Your email address will not be published.Required fields are marked *