Security task operations

A security task operation is a specific resource in Microsoft Dynamics GP for which security access can be controlled.

Security task operation elements

A security task will have several security task operations assigned to it. These are the resources to which access is being granted. Each security task operation has the following elements:

Task ID   This is the ID of the security task to which an operation is being added. You can add operations to your own tasks, or to existing Microsoft Dynamics GP tasks.

Product ID   This specifies the dictionary that contains the resource for which a security operation is being added.

Resource type   This indicates the type of resource for which a security operation is being added. The value corresponds to one of the following constants:

[spacer]

Contant

Value

TABLETYPE

1

FORMTYPE

2

REPORTTYPE

23

SECURITYTYPE_LISTS

900

SECURITYTYPE_SMARTLISTOBJECT

1000


Security ID   The security ID is a long integer value that identifies the specific resource for which a security operation is being added. The following table lists the security resource types and the corrensponding security ID values:

[spacer]

Security resource type

Security ID

Tables

Table Resource ID

Forms

Form Resource ID

Reports

Report Resource ID

Lists

Dictionary-specific ID for the list

SmartLists

Dictionary-specific ID for the SmartList object


To build the security ID for a list, use the BuildDictSpecificID() function. The following constants are defined for the portions of the list for which security can be controlled:

[spacer]

Constant

Description

LISTSECURITYTYPE_LIST

The base list

LISTSECURITYTYPE_PREVPANE

The information pane for the list

LISTSECURITYTYPE_CUSTOMIZE

The customization capability for the list


Use one of these constants as the product ID (first parameter) for the BuildDictSpecificID() function. Use the unique integer identifier you assigned to the list as the action (second parameter).

To build the security ID for a SmartList object, use the BuildDictSpecificID() function. Use your dictionary ID (first parameter) and the ID value you assigned to the SmartList object you created as the action (second parameter).

Adding security task operations

To add a security task operation to a task in Microsoft Dynamics GP, use the AddSecurityTaskOperation() function of the sySecurityTaskOperations form. The following example uses this function to add various security operations to the CARD_IGSAMPLE_01 security task for the sample integrating application.

local long status;
local string taskID;

taskID = "CARD_IGSAMPLE_01";

{Lead Maintenance form}
status = AddSecurityTaskOperation(taskID,
	IG_PROD_ID,
	FORMTYPE,
	resourceid(form IG_Lead_Maintenance)) 
	of form sySecurityTaskOperations;

{Leads report}
status = AddSecurityTaskOperation(taskID,
	IG_PROD_ID,
	REPORTTYPE,
	resourceid(report IG_Leads)) 
	of form sySecurityTaskOperations;

{Lead master table}
status = AddSecurityTaskOperation(taskID,
	IG_PROD_ID,
	TABLETYPE,
	resourceid(table IG_Leads_MSTR))
	of form sySecurityTaskOperations;

{Leads list - Base List}
{The value 1 is the ID of the Lead list}
status = AddSecurityTaskOperation(taskID,
	IG_PROD_ID,
	SECURITYTYPE_LISTS,
	BuildDictSpecificID(LISTSECURITYTYPE_LIST, 1))
	of form sySecurityTaskOperations;

{Leads list - Information Pane}
status = AddSecurityTaskOperation(taskID,
	IG_PROD_ID,
	SECURITYTYPE_LISTS,
	BuildDictSpecificID(LISTSECURITYTYPE_PREVPANE, 1)) 
	of form sySecurityTaskOperations;

{Leads list - Customization}
status = AddSecurityTaskOperation(taskID,
	IG_PROD_ID,
	SECURITYTYPE_LISTS,
	BuildDictSpecificID(LISTSECURITYTYPE_CUSTOMIZE, 1)) 
	of form sySecurityTaskOperations;

{Leads SmartList}
status = AddSecurityTaskOperation(taskID,
	SMARTLIST,
	1000, {Use constant SECURITYTYPE_SMARTLISTOBJECT in GP 10 SP1 and later}
	BuildDictSpecificID(IG_PROD_ID, SMARTLIST_OBJECTTYPE_LEADS))
	of form sySecurityTaskOperations;

You can use the Exists() -- Security Task Operation function to find out whether a security operation has already been added to a security task.



Documentation Feedback