Please enable JavaScript to view this site.

Navigation: Advanced topics > Events > Table events

Get Table Permissions

Scroll Prev Next More

Description

The GetTablePermissions event occurs after the table is initialized. Use this event to assign user a different set of permissions.

Syntax

public XVar GetTablePermissions(dynamic permissions)

Arguments

permissions

a string containing permissions calculated for a given user and table.

Return value

a string containing permissions calculated for a given user and table.

A - Add;

D - Delete;

E - Edit;

S - List/View/Search;

P - Print/Export;

I - Import;

M - Admin option. A user can see all records in the table.

Applies to pages

All table specific pages like List, Print, Edit, List, Add, Export etc.

Example

Prohibit the editing of table data on the weekends:

 

dynamic dw = XVar.Clone(MVCFunctions.date(new XVar("w")));
if(dw == XVar.Pack(0)) || dw == XVar.Pack(6))
{
  permissions = new XVar("S");
}
return permissions;

See also:

Security API: setPermissions

Security API :getPermissions

User group permissions

Choose Pages Screen

Event: After table initialized

Event: IsRecordEditable