Security Administration (ISecurityAdmin Interface) |
Creates an ACT.
Category: ACT administration methods
Syntax |
CreateAccessControlTemplate(tCtxt,REPOSresource,ACT_attributes);
Parameters |
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= |
specifies a description of the ACT. A string up to 200 characters is supported. |
Use= |
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; } }
Related Methods |
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.