CreateAccessControlTemplate

Short Description

Creates an ACT.

Category

ACT administration methods

Syntax

CreateAccessControlTemplate(tCtxt,REPOSresource,ACT_attributes);

Parameters

Method Parameters
Parameter
Type
Direction
Description
tCtxt
string
in
Optional handle representing a server-side transaction context.
REPOSresource
string
in
Optional resource identifier for the repository in which the ACT is created. If TCTXT is used, do not specify a value in RESOURCE.
ACT_attributes
string array
in
Passed two-dimensional string array that defines ACT attributes in two columns. Column 1 specifies the attribute name. Column 2 specifies the attribute value.

Details

The CreateAccessControlTemplate method creates an ACT object. You must use the SetAuthorizationOnObjs method with the SETACTCONTENTS parameter set to TRUE to add or remove authorizations on the ACT object.
Only the Name attribute is required to be defined in ACT_ATTRIBUTES to create an ACT object. The Name value must be unique in the target repository.
Two other attributes are supported in ACT_ATTRIBUTES:
Desc="text"
specifies a description of the ACT. A string up to 200 characters is supported.
Use="null | REPOS"
specifies an empty string or the value REPOS. An empty string indicates the ACT is applied to one or more objects in the repository. The value REPOS sets the ACT as the repository default ACT.
To change the attributes of an existing ACT, use the SetAccessControlTemplateAttribs method.
TCTXT identifies an optional transaction context in which to execute the request. When TCTXT is null, the ACT is immediately persisted to the SAS Metadata Server instead of being cached in a transaction context.

Exceptions Thrown

The SAS Open Metadata Interface explicitly returns the following exceptions for the CreateAccessControlTemplate method:
  • SECAD_INVALID_TC_HANDLE
  • SECAD_INVALID_REPOS_SPEC
  • SECAD_ACT_ALREADY_EXISTS
  • SECAD_NOT_AUTHORIZED

Examples

The following code fragment shows how the CreateAccessControlTemplate method is issued in a Java environment:
public void createAccessControlTemplate(String transCtxt, String repository, 
String[][] ACTattributes ) throws Exception {
		
		try
		{
	iSecurityAdmin.CreateAccessControlTemplate(transCtxt, repository, ACTattributes);
		}
		catch (Exception e) {
			System.out.println("CreateAccessControlTemplate: Exceptions");
			e.printStackTrace();
			throw e;
		}
}
The following example issues the CreateAccessControlTemplate method to create an ACT in the repository defined in REPOSRESOURCE:
public void createAccessControlTemplate() throws Exception {

// Name and Desc values for ACT                
        final String[][] ActAttribs = 
        {
                {"NAME", testUserACTname},
                {"DESC", "ACT to project testUser's resources"}
        };
 // Repository in which the ACT will be created 
               StringHolder REPOSresource = new StringHolder(REPOSID:_reposid);                              
        try {
              iSecurityAdmin. createAccessControlTemplate("", REPOSresource.value, 
ActAttribs);  
                 }
        catch (Exception e ){
                throw e;
        }
}