Previous Page | Next Page

Security Administration (ISecurityAdmin Interface)

ApplyACTToObj

Applies the authorizations defined in an ACT to the specified resource.

Category: General authorization administration methods


Syntax

ApplyACTToObj(tCtxt,resource,flags,ACTresource);


Parameters

Parameter Type Direction Description
tCtxt string in Optional handle representing a server-side transaction context.
resource string in Optional resource identifier of the object to which the ACT should be applied. If TCTXT is used, do not specify a value in RESOURCE.
flags int in Currently unused. Callers should set this parameter to 0.
ACTresource string in Passed resource identifier of an ACT.


Details

The ACT must exist before you can apply it with the ApplyACTToObj method. You can create an ACT with the CreateAccessControlTemplate method.

When TCTXT is set to a valid value, the permanent application of the ACT is deferred until the EndTransactionContext method is invoked on a resource with the SECAD_COMMIT_TC flag. However, a subsequent call to the GetAccessControlTemplatesOnObj method with the TCTXT value returns the applied ACT for the object represented by TCTXT.

When TCTXT is null and RESOURCE is set to a valid value, the ACT is applied to the specified resource immediately by the SAS Metadata Server.

The method fails if the caller does not have WriteMetadata permission on the target resource, and ReadMetadata permission for the ACT being applied.


Exceptions Thrown

The SAS Open Metadata Interface explicitly returns the following exceptions for the ApplyACTToObj method:


Examples

The following code fragment shows how the ApplyACTToObj method is issued in a Java environment:

public void applyAccessControlTemplateToObj(String transCtxt, String resource,
int options, String ACTspec ) throws Exception {
		
			try
			{
				iSecurityAdmin.ApplyACTToObj(transCtxt, resource, options, ACTspec);
			}
            catch (Exception e)
        {
              System.out.println("ApplyACTToObj: Exceptions");
              e.printStackTrace();  
              throw e;
        }
}

The following example issues the ApplyACTToObj method to apply a predefined ACT to an existing Tree object that represents a folder. The ACT is identified by ACTSPEC:

public void ApplyACTToObj() throws Exception {  
       // Define an object variable for the Tree 
      Tree_URN = "OMSOBJ:Tree/metadata-identifier";
                                     
     // Apply the ACT to a Tree. Because a value is specified in the 
     // resource parameter, the tCtxt parameter is null. 
     iSecurityAdmin.ApplyAccessControlTemplateToObj("",Tree_URN, 0, ACTspec);     

     //If we had submitted a tCtxt value, resource would be null.              
                                
         }
        catch (Exception e)
        {
                throw e;
        }
}


Related Methods

Previous Page | Next Page | Top of Page