Adding a Role

This RESTful web service request can be used to add a role and define the privileges that are associated with the role.

HTTP Method: POST

REST URL Format:

http://host:port/ibi_apps/rs/ibfs/SSYS/ROLES/Role

where:

host

Is the name of the system where WebFOCUS is installed.

port

Is the port number used by WebFOCUS.

Role

Is the name of the role to be added.

Body Format:

IBIRS_action=put&IBIRS_object=Object

where:

Object

Is the XML object that defines the privileges associated with the role.

This XML object must have the following structure:

<object _jt="IBFSPermissionSetObject" description="RoleDescription" showPermissions="true"
       subsysNameList="Subsystem" type="PermissionSet">
 <pSet _jt="IBSSPermissionSet" compLvl="100"  shipped="true">
   <policy _jt="IBSSPolicy">
     <policy _jt="EnumMap" _keyJT="IBSSOperation">
       <entry>
         <key _jt="IBSSOperation" name="Privilege1"/>
         <value _jt="IBSSVerb" name="PERMIT"/>
       </entry>
       <entry>
         <key _jt="IBSSOperation" name="Privilege2"/>
         <value _jt="IBSSVerb" name="PERMIT"/>
       </entry>
     </policy>
   </policy>
   <subsysList _jt="ArrayList">
     <item _jt="IBFSSubsystem" index="0" name="Subsystem"/>
   </subsysList>
  </pSet>
</object>

where:

RoleDescription

Is the description of the role.

Subsystem

Is the subsystem associated with the role. Valid values include:

  • Session
  • WFC
  • BIP
  • EDA
  • USERS
  • GROUPS
  • ROLES
  • FILE
  • WEB
PrivilegeN

Is the privilege name that is a associated with the role. Each privilege is assigned within the opening and closing Entry tags. For a list of valid privileges, see Listing Privileges.

Example:

In the following example, a role called LibraryCustom is added. The description for the role is Library Privilege - Custom. The subsystem that the role is associated with is WFC. The privileges assigned to this role are opLibrary, opList, opDisplayVersionInfo, opRCExplorer, opPortalAccess, and opBidRunTime.

Request:

http://localhost:8080/ibi_apps/rs/ibfs/SSYS/ROLES/LibraryCustom

Body:

IBIRS_action=put&object=<object _jt="IBFSPermissionSetObject" description="Library Privilege - Custom" showPermissions="true" subsysNameList="WFC" type="PermissionSet">
<pSet _jt="IBSSPermissionSet" compLvl="100"  shipped="true">
 <policy _jt="IBSSPolicy">
 <policy _jt="EnumMap" _keyJT="IBSSOperation">
      <entry>
          <key _jt="IBSSOperation" name="opLibrary"/>
          <value _jt="IBSSVerb" name="PERMIT"/>
     </entry>
     <entry>
         <key _jt="IBSSOperation" name="opList"/>
         <value _jt="IBSSVerb" name="PERMIT"/>
     </entry>
     <entry>
         <key _jt="IBSSOperation" name="opDisplayVersionInfo"/>
         <value _jt="IBSSVerb" name="PERMIT"/>
    </entry>
    <entry>
        <key _jt="IBSSOperation" name="opRCExplorer"/>
        <value _jt="IBSSVerb" name="PERMIT"/>
     </entry>
     <entry>
         <key _jt="IBSSOperation" name="opPortalAccess"/>
         <value _jt="IBSSVerb" name="DENY"/>
     </entry>
     <entry>
         <key _jt="IBSSOperation" name="opBidRunTime"/>
         <value _jt="IBSSVerb" name="PERMIT"/>
     </entry>
    </policy>
  </policy>
  <subsysList _jt="ArrayList"><item _jt="IBFSSubsystem" index="0" name="WFC"/></subsysList>
</pSet>
</object>

Response:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<ibfsrpc _jt="IBFSResponseObject" language="EN" name="put" returncode="10000" returndesc="SUCCESS" subreturncode="0"
         subsystem="SSYS" type="simple">
   <ibfsparams size="5">
      <entry key="IBIRS_replace" value="true"/>
      <entry key="IBIRS_private" value="__null"/>
      <entry key="IBIRS_object" value="&lt;object _jt=&quot;IBFSPermissionSetObject&quot; description=&quot;Library Privilege - Custom&quot;
              showPermissions=&quot;true&quot; subsysNameList=&quot;WFC&quot; type=&quot;PermissionSet&quot;&gt;
              &lt;pSet _jt=&quot;IBSSPermissionSet&quot; compLvl=&quot;100&quot;  shipped=&quot;true&quot;&gt;
              &lt;policy _jt=&quot;IBSSPolicy&quot;&gt;  &lt;policy
_jt=&quot;EnumMap&quot; _keyJT=&quot;IBSSOperation&quot;&gt;
              &lt;entry&gt;&lt;key _jt=&quot;IBSSOperation&quot; name=&quot;opLibrary&quot;/&gt;  &lt;value _jt=&quot;IBSSVerb&quot;
              name=&quot;PERMIT&quot;/&gt;  &lt;/entry&gt;   &lt;entry&gt;&lt;key _jt=&quot;IBSSOperation&quot; 
              name=&quot;opList&quot;/&gt;  &lt;value _jt=&quot;IBSSVerb&quot; name=&quot;PERMIT&quot;/&gt;   &lt;/entry&gt;
              &lt;entry&gt;&lt;key _jt=&quot;IBSSOperation&quot; name=&quot;opDisplayVersionInfo&quot;/&gt;
              &lt;value _jt=&quot;IBSSVerb&quot; name=&quot;PERMIT&quot;/&gt;    &lt;/entry&gt;
              &lt;entry&gt;&lt;key _jt=&quot;IBSSOperation&quot; name=&quot;opRCExplorer&quot;/&gt;  &lt;value _jt=&quot;IBSSVerb&quot;
              name=&quot;PERMIT&quot;/&gt;  &lt;/entry&gt;  &lt;entry&gt;&lt;key _jt=&quot;IBSSOperation&quot;
              name=&quot;opPortalAccess&quot;/&gt;  &lt;value _jt=&quot;IBSSVerb&quot; name=&quot;DENY&quot;/&gt;  &lt;/entry&gt;
              &lt;entry&gt;&lt;key _jt=&quot;IBSSOperation&quot; name=&quot;opBidRunTime&quot;/&gt;  &lt;value _jt=&quot;IBSSVerb&quot;
              name=&quot;PERMIT&quot;/&gt;  &lt;/entry&gt;  &lt;/policy&gt;  &lt;/policy&gt;
              &lt;subsysList _jt=&quot;ArrayList&quot;&gt;&lt;item
_jt=&quot;IBFSSubsystem&quot; index=&quot;0&quot;
              name=&quot;WFC&quot;/&gt;&lt;/subsysList&gt; &lt;/pSet&gt; &lt;/object&gt; "/>
      <entry key="IBIRS_args" value="__null"/>
      <entry key="IBIRS_" value="/SSYS/ROLES/LibraryCustom"/> 
   </ibfsparams>
   <rootObject _jt="IBFSPermissionSetObject" description="Library Privilege - Custom" dummy="false" fullPath="IBFS:/SSYS/ROLES/LibraryCustom"
               name="LibraryCustom" policy="////D///9+f/////f/////////8AAAA=" rsPath="/ibi_apps/rs/ibfs/SSYS/ROLES/LibraryCustom"
               showPermissions="false" subsysNameList="WFC" type="PermissionSet">
      <pSet _jt="IBSSPermissionSet" compLvl="100" description="Library Privilege - Custom" name="LibraryCustom" shipped="false">
         <policy _jt="IBSSPolicy" derivedDate="1349168261272">
            <policy _jt="EnumMap" _keyJT="IBSSOperation" size="3">
               <entry>
                  <key _jt="IBSSOperation" name="opLibrary"/>
                  <value _jt="IBSSVerb" name="PERMIT"/>
               </entry>
               <entry>
                  <key _jt="IBSSOperation" name="opList"/>
                  <value _jt="IBSSVerb" name="PERMIT"/>
               </entry>
               <entry>
                  <key _jt="IBSSOperation" name="opRCExplorer"/>
                  <value _jt="IBSSVerb" name="PERMIT"/>
               </entry>
            </policy>
         </policy>
         <subsysList _jt="ArrayList" size="1">
            <item _jt="IBFSSubsystem" index="0" name="WFC"/>
         </subsysList>
      </pSet>
   </rootObject>
</ibfsrpc>

If the value for the returncode attribute in the XML response is 10000, then the role was successfully added.


WebFOCUS