Solaris WBEM Developer's Guide

Solaris_NamespaceAcl Class

The Solaris_NamespaceAcl extends the Solaris_Acl base class and inherits the string property capability with a default value r (read-only for all users). The Solaris_NamespaceAcl class defines this key property.

Property 

Data Type 

Purpose 

nspace

string

Identifies the name space to which the access control list applies. Only one instance of the name space ACL can exist in a name space.

ProcedureTo Set Access Control for a Name Space

Steps
  1. Create an instance of the Solaris_namespaceAcl class.

    ...
    /* Create a name space object initialized with root\security  
    (name of name space) on the local host. */   
    CIMNameSpace cns = new CIMNameSpace("", "root\security"); 
    
    // Connect to the root\security name space as root. 
    cc = new CIMClient(cns, user, user_passwd);
    
    // Get the Solaris_namespaceAcl class 
    cimclass = cc.getClass(new CIMObjectPath("Solaris_namespaceAcl");
    
    // Create a new instance of the Solaris_namespaceAcl 
    class ci = cimclass.newInstance();
    ...
  2. Set the capability property to the desired access rights.

    ...
    /* Change the access rights (capability) to read/write 
    to the root\molly name space. */
    ci.setProperty("capability", new CIMValue(new String("rw")); 
    ci.setProperty("nspace", new CIMValue(new String("root\molly"));
    ...
  3. Update the instance.

    // Pass the updated instance to the CIM Object Manager 
    cc.createInstance(new CIMObjectPath(), ci);