Security roles

Each user in Microsoft Dynamics GP is assigned to one or more security roles. Each security role contains a set of security operations that can be accessed by users in that role.

Security role elements

Each security role has the following elements:

Role ID   This value uniquely identifies the security role. The role ID should be in uppercase.

Role Name   This is the name that is displayed for the security role. It should be descriptive, indicating what sort of tasks it is providing access to.

Role Description   The description provides additional detail about exactly what resources the security role provides access to.

Creating security roles

To create a security role in Microsoft Dynamics GP, use the CreateSecurityRole() function of the sySecurityRole form. The following example uses this function to create the LEAD GENERATION security role for the sample integrating application.

local long status;
local string roleID;

{Add the Lead Generation security role}
roleID = "LEAD GENERATION";
if Exists(roleID) of form sySecurityRole = false then
	{Role does not exist, so create it}
	status = CreateSecurityRole(roleID, {ID}
		"Lead Generation", {Name}
		"Tasks include creating and updating customer leads.") {Description}
		of form sySecurityRole;
end if;

You can use the Exists() -- Security Role function to find out whether a security role has already been created.


Adding tasks to security roles

To add tasks to a security role, use the AddTaskToRole() function of the sySecurityTaskRole form. The following example uses this function to add the CARD_IGSAMPLE_01 security task to the LEAD GENERATION security role.

local long status;
local string roleID;

roleID = "LEAD GENERATION";
status = AddTaskToRole(roleID, "CARD_IGSAMPLE_01") of form sySecurityTaskRole;

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



Documentation Feedback