Delete Permissions of the Specified User/Group/Role

<< Click to Display Table of Contents >>

Current:  System Integration > WebAPI 

Delete Permissions of the Specified User/Group/Role

Previous pageReturn to chapter overviewNext page

Version: 9.1

Request address

http://ip:port/bi/api?action=delPermission&token=xxxx

Request message

Request parameter

required parameter:xmlData (required)

<?xml version="1.0" encoding="UTF-8"?>

<info>

<perm>

<refs>

 <ref>

  <type>db</type>

  <path>test_db1</path>

 </ref>

 <ref>

  <type>db</type>

  <path>test_db2</path>

 </ref>

</refs>

<rperm>

 <r>

  <type>user</type>

  <name>test_user</name>

 </r>

 <r>

  <type>group</type>

  <name>group-1</name>

  <parent>group</parent>

 </r>

 <r>

  <type>role</type>

  <name>test_role</name>

 </r>

</rperm>

<wperm>

 <w>

  <type>user</type>

  <name>test_user</name>

 </w>

</wperm>

</perm>

</info>

parametric description

1) refs-ref-type (required): the node type to be specified, including resource type and operation type.

2) refs-ref-path (required): To specify the path of the node type, when specifying the operation type, leave this item blank.

3) rperm (optional): read permission.

4) rperm-r-type (required for read permission): the node type with read permission, including users, groups, and roles.

5) rperm-r-name (required for read permission): the name of the node with read permission.

6) rperm-r-parent (optional for read permission): When the node type is a group, the path of the group.

7) wperm (optional): write permission

8) wperm-w-type (required for write permission): the type of node with write permission, including users, groups, and roles.

9) wprem-w-name (required for write permission): the name of the node with write permission.

10) wperm-w-parent (optional when writing permissions): When the node type is a group, the path of the group.

Description:

1) At least one of rperm and wperm is optional, and both may contain multiple child nodes.

2) Multiple resources or operations can be specified in refs, and batch deletion is supported.

Sample

function delPermission() {

        var xml = getXml();

        $.post("http://" + ip + ":" + port + "/" + project + "/api?action=delPermission&token=xxxx",

           {xmlData : xml},

           function(result) {        

              writeXml(result);

           });

     }

Response message

Response result

 

1) Successful operation

<?xml version="1.0" encoding="UTF-8"?>

 <results>

  <result>

   <level>1</level>

   <message>Operates successfully.</message>

  </result>

</results>>

2) Operation failed

<?xml version="1.0" encoding="UTF-8"?>

<results>

 <result>

  <level>6</level>

  <message>The Users, Groups or Roles "test_user" does not exist.</message>

 </result>

</results>

or

<?xml version="1.0" encoding="UTF-8"?>

 <results>

  <result>

   <level>6</level>

   <message>The resource or operation "test_db1" could not be found. </message>

  </result>

 </results>

Result description

The response result information is xml. direct parse.

1) Level return type, different values represent different return status, see appendix.

2) Message is the interface operation result information.