Providing security for edit method

Hi all,

How to provide security for edit method in form level?

Regards,

Kuppusamy S

Hello Kuppusamy,

In theory, a display method can expose any data from any table. If a display method returns data from another table (or another row in the same table), it poses a threat—this threat is surfaced as a Trustworthy Computing conflict. Whenever you use a display or edit method to return a value from another row, you must evaluate the business impact of displaying the data.

To resolve conflicts associated with the use of display and edit methods, follow these steps:

  • Evaluate each display method that returns data from another row, either in the same table or in a different table.

  • Determine whether this data poses an information-disclosure threat.

  • If the data does pose a threat, perform explicit authorization checks and throw an exception if access is unauthorized. The following code shows an explicit authorization:

if (hasSecurityKeyAccess(securitykeyNum(mySecurityKey), AccessType::View))

{

myMethod();

}

if (hasMenuItemAccess(menuItemDisplayStr(myMenuItem), MenuItemType::Display)))

{

myMethod();

}

DictTable dictTable = new DictTable(tablenum(myTable));

if (dictTable.rights >= AccessType::Insert))

{

myMethod();

}

if (isConfigurationkeyEnabled(configurationkeyNum(myConfigurationKey))

{

myMethod();

}

Hello Kuppusamy,

You can also manually activate Record Level Security in the display or edit method as shown in the below code example:

public void run

{

CustTable custTable;

super();

// Ensure RLS is used

custTable.recordLevelSecurity(true);

while select custTable

{

listView.add(custTable.name);

}

}

Hi Shankar,

Thanks for your post… Project module - Common forms - Project details - Item Task button - Item requirement - Functions button - create puchase order form - overview tab - vendor account field(edit method) gives a lookup(VendAccountItemLookup). Lookup has data for few users but not for others. What could be the problem? Kindly suggest me solutions. Is it related to security problem or something else?

Regards,

Kuppusamy S.

Hello Kuppusamy,

Can you please check whether you are getting this issue for all the users or is it specific to the users of a particular user group?