Advanced Portal Designer Documentation
Index

Security Filters and Table Permissions

Security Setup in APD controls data access through security filters and table permissions. This provides row-level and operation-level security for portal data access.

Security Setup Overview

The Security Setup page contains two types of entries:

  1. Security Filters - Row-level data restrictions
  2. Table Permissions - AJAX operation permissions

Accessing Security Setup

  1. Open the Advanced Portal Designer menu page (search for it in Tell Me) and click Security Settings (or the equivalent entry that opens the Security Setup list)
  2. View and manage security entries

Security Filter Properties

Field Description
Profile Security profile (blank = all)
Security Type "Security Filter"
Table Target table number
Field Target field number
Value Filter value/expression
Action Code Specific action (optional)

Security Filter Values

Placeholder Values

Use placeholders for dynamic filtering:

Placeholder Description Example
%1 User ID JOHN.DOE
%2 Company CRONUS
%3 Session ID abc123...
%4 NAV Identification 10000 (Customer No.)

Usage Examples

Limit to User's Customer:

Table: Sales Header (36)
Field: Sell-to Customer No. (2)
Value: %4

Limit to User's Company:

Table: Customer (18)
Field: Global Dimension 1 Code (88)
Value: %2

Limit to User's Salesperson:

Table: Sales Header (36)
Field: Salesperson Code (43)
Value: %1

Creating Security Filters

Step-by-Step

  1. Open Security Setup
  2. Click New
  3. Select Security Type: Security Filter
  4. Enter Table number
  5. Enter Field number
  6. Enter Value (with placeholders if needed)
  7. Optionally set Profile and Action Code
  8. Save

Filter Examples

Customer Self-Service:

Profile: CUSTOMER
Security Type: Security Filter
Table: 36 (Sales Header)
Field: 2 (Sell-to Customer No.)
Value: %4

Sales Team by Salesperson:

Profile: SALES
Security Type: Security Filter
Table: 18 (Customer)
Field: 86 (Salesperson Code)
Value: %1

Manager by Department:

Profile: MANAGER
Security Type: Security Filter
Table: 36 (Sales Header)
Field: 80 (Responsibility Center)
Value: SALES

Table Permissions

Permission Properties

Field Description
Profile Security profile (blank = all)
Security Type "Table Permissions"
Table Target table number
Action Code Specific action (optional)
Allow Ajax Read Permit read via AJAX
Allow Ajax Validate/Modify Permit validate/update via AJAX
Allow Ajax Insert Permit create via AJAX
Allow Ajax Delete Permit delete via AJAX
Allow Ajax Lookup Permit lookup popups
Allow Ajax Insert On Validate Permit APD_validate to create a record if it doesn't exist yet

Creating Table Permissions

  1. Open Security Setup
  2. Click New
  3. Select Security Type: Table Permissions
  4. Enter Table number
  5. Set permission flags as needed
  6. Optionally set Profile and Action Code
  7. Save

Permission Examples

Customer Read-Only:

Profile: CUSTOMER
Security Type: Table Permissions
Table: 36 (Sales Header)
Allow Ajax Read: Yes
Allow Ajax Validate/Modify: No
Allow Ajax Insert: No

Sales CRUD:

Profile: SALES
Security Type: Table Permissions
Table: 36 (Sales Header)
Allow Ajax Read: Yes
Allow Ajax Validate/Modify: Yes
Allow Ajax Insert: Yes

Admin Full Access (per-table — set on every table you want full AJAX access for):

Profile: ADMIN
Security Type: Table Permissions
Table: <table number>
Allow Ajax Read: Yes
Allow Ajax Validate/Modify: Yes
Allow Ajax Insert: Yes
Allow Ajax Delete: Yes

Action-Specific Security

Per-Action Filters

Apply filters only for specific actions:

Profile: CUSTOMER
Security Type: Security Filter
Table: 36 (Sales Header)
Field: 2 (Sell-to Customer No.)
Value: %4
Action Code: ORDERS

This filter only applies when executing the ORDERS action.

Per-Action Permissions

Profile: SALES
Security Type: Table Permissions
Table: 18 (Customer)
Action Code: CUSTOMER-EDIT
Allow Ajax Read: Yes
Allow Ajax Validate/Modify: Yes
Allow Ajax Insert: No

How Filters Apply

Filter Evaluation

  1. User accesses an action
  2. APD collects applicable filters:
    • Matching profile or blank profile
    • Matching table
    • Matching action or blank action
  3. Filters are applied to RecordRef
  4. User sees only matching records

Filter Group

Security filters use Filter Group 6:

  • Applied automatically
  • Cannot be overridden by template filters
  • Always in effect for matching users

Multiple Filters

Cumulative Filters

Multiple filters on the same table are cumulative (AND logic):

Filter 1:
  Table: Customer
  Field: Blocked
  Value: No

Filter 2:
  Table: Customer
  Field: Country/Region Code
  Value: US|CA

Result: Only unblocked customers in US or Canada.

Profile Combinations

When user has multiple profiles:

  • Filters from all profiles apply
  • Most restrictive combination used
  • Permissions combine (OR logic)

Common Patterns

Customer Portal

-- Limit orders to customer --
Profile: CUSTOMER
Table: 36 (Sales Header)
Field: 2 (Sell-to Customer No.)
Value: %4

-- Limit order lines to customer's orders --
Profile: CUSTOMER
Table: 37 (Sales Line)
Field: 2 (Sell-to Customer No.)
Value: %4

-- Limit invoices to customer --
Profile: CUSTOMER
Table: 112 (Sales Invoice Header)
Field: 2 (Sell-to Customer No.)
Value: %4

Vendor Portal

-- Limit purchase orders to vendor --
Profile: VENDOR
Table: 38 (Purchase Header)
Field: 2 (Buy-from Vendor No.)
Value: %4

-- Limit to open orders --
Profile: VENDOR
Table: 38 (Purchase Header)
Field: 120 (Status)
Value: Open|Released

Salesperson Portal

-- Limit customers to salesperson --
Profile: SALES
Table: 18 (Customer)
Field: 86 (Salesperson Code)
Value: %1

-- Limit orders to salesperson's customers --
Profile: SALES
Table: 36 (Sales Header)
Field: 43 (Salesperson Code)
Value: %1

Field-Level Security

APD ships a separate Field Security table (APD Field Security Hgd) for per-field rules — there is no Field Filter value on the Security Setup's Security Type option (the only values are Security Filter and Table Permissions).

A Field Security record specifies:

Field Description
Security Profile Profile the rule applies to
Table No. Table number
Field No. Field number
Allow Validate If false, APD will block validate/modify operations on this field for users with this profile

Use Field Security to block validation/modification of a specific field for a given profile. It is not a "hide" mechanism — to suppress display in templates, simply omit the field from the template (or guard it with a <?profile?> block).

Troubleshooting

No Data Showing

  1. Check if filter is too restrictive
  2. Verify placeholder values are correct
  3. Check user's NAV Identification is set
  4. Test filter value manually

Wrong Data Showing

  1. Review all applicable filters
  2. Check for conflicting filters
  3. Verify profile assignments
  4. Check action-specific filters

AJAX Operations Failing

  1. Check table permissions exist
  2. Verify profile matches
  3. Check specific permission flags
  4. Review action code restrictions

Testing Filters

Debug Approach

  1. Create test user with specific profile
  2. Log in as test user
  3. Access relevant action
  4. Verify data visibility
  5. Test AJAX operations

Verify Filter Application

Check that filters are working:

<!-- Display filter info for debugging -->
<?auth?>
    <p>User: <?userid?></p>
    <p>Company: <?company?></p>
    <p>No: <?no?></p>
<?endif?>

Best Practices

Principle of Least Privilege

  • Start with restrictive filters
  • Add access as needed
  • Default to no AJAX permissions

Test Thoroughly

  • Test each profile combination
  • Verify data isolation
  • Check edge cases

Document Filters

Maintain a security matrix:

Profile Table Filter AJAX
CUSTOMER Sales Header Own records Read only
SALES Customer Assigned Full CRUD

Use Action Codes

For complex scenarios, use action-specific filters:

-- Different access by action --
Action: VIEW-ORDER (read only)
Action: EDIT-ORDER (modify allowed)