can we read privileges using SDK?

In API we do have IRole which we read by Admin instance and nodeconstants.
can we read privileges by any way?

Add Comment
3 Answer(s)

ameansap,

Did you resolve this?  And if yes, what did you find out?  Could you leave some insight for us here?

Agile Angel Answered on July 26, 2016.
Add Comment

No 🙁

I tried IRole and INode but not able to access privileges. We can access roles but not privileges.

INode nodeRoles = (INode)session.getAdminInstance().getNode(NodeConstants.NODE_ROLES);
INode nodepri = (INode)session.getAdminInstance().getNode(NodeConstants.NODE_PRIVILEGES);
IRole role1 = (IRole)nodeRoles.getChildNode(“ViewAllItemsInfo”);

Agile User Answered on July 29, 2016.
Add Comment

Hi Ameansap,

Yes,we can read privileges using SDK ,Please Refer below piece of code :

IAdmin admin = session.getAdminInstance();
INode node = admin.getNode(“Privileges”);
System.out.println(node.getChildNodes());//get all privileges
INode node1 = (INode) node.getChild(“Create Customers”);//Specify name of your privilege
IProperty[] props = (IProperty[]) node1.getProperties();
for (int i = 0; i < props.length; i++)// loop to check properties of privileges
{
String propname= props[i].getName();
System.out.println(“Name : ” + propname);
Object value = props[i].getValue();
System.out.println(“Value : ” + value);

}
This would help you to read privileges.Let me know if you have any queries.
Thanks,
Kalyani

Agile User Answered on August 1, 2016.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.