Excluding resources from security checks

You may not want to have security access checked for a specific resource. For example, a command form you create for your integration should be excluded from security checks so it is always available to every user.

To exclude a form from the security check, set the Title property of the main window for the form to the value ~internal~. Use this for forms that must be opened, but won’t display windows, such as command forms.

To exclude any type of resource (including forms) from security checks, register a function trigger for the ExcludeFromSecurity() function of the sySecurityTaskEntry form. This function is called each time a resource is accessed, allowing the script to determine whether the resource should be excluded from security. The following example shows the trigger registration for this function:

local integer l_result;

l_result = Trigger_RegisterFunction(function ExcludedFromSecurity of form sySecurityTaskEntry, TRIGGER_AFTER_ORIGINAL, function IG_ExcludeFromSecurity);
if l_result <> SY_NOERR then
	warning "Trigger registration for excluding security items failed.";
end if;

The following is the trigger processing function that excludes items from security checks for the sample integrating application. If the specific resource indicated by the parameters passed to the function should be excluded from security checks, the procedure sets the return value of the function to true. Notice that the function first checks the return value passed into the function. If it has the value true, other code has (such as core Dynamics GP code) has determined that the item should be excluded from security checks. Thus, no action needs to be performed by this function.

function returns boolean exclude;

in integer dict_ID;
in long security_ID;
in integer security_restype;

{If the resource has already been excluded, then don't do further processing.}
if exclude = false then
	{Is it our resource to check?}
	if dict_ID = IG_PROD_ID then
		{Is it an item to exclude?}
		if security_restype = FORMTYPE then
			if security_ID = resourceid(form IG_Lead_Inquiry) then
				exclude = true;
			end if;
		end if;
	end if;
end if;


Documentation Feedback