Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
permission checking via lapi
Loretta_Goralczyk_(goralczyk.loretta@gene.com_-_(d
Is there a lapi call that takes a User ID and an object ID and returns the permissions for that user for that object?I know of the GetObjectRights and ListRights calls, but I'd rather not compare the groups IDs myself. I'd also like to do this without calling impersonateUser.Thanks
Find more posts tagged with
Comments
Sandra_Lindquist
Im trying to figure out the best way to determine permission on a node as well without having to compare each set of permissions... Is there anyway to do this?
Geoff_Price_(JTASCAdmin_(Delete)_1422989)
I ran into the same thing. You have to use GetObjectRights to get the RecArray containing the rights and user/group. I use this:
LLValue objRights = (new LLValue()).setRecord();
doc.GetObjectRights(volID, objID, objRights);
boolean canEditPerms = false;
boolean canModify = false;
// Enumerate through the objRights Rec Array
LLValueEnumeration rights_enum = objRights.enumerateValues();
while (rights_enum.hasMoreElements()) {
LLValue rightsElement = rights_enum.nextValue();
int rPerms = rightsElement.toValue("PERMISSIONS").toInteger();
int rightID = rightsElement.toValue("RIGHTID").toInteger();
if (rightID == userID) {
// userID is determined earlier as the current Livelink user. canEditPerms = ( (rPerms & pEDITPERMS) == pEDITPERMS );
canModify = ( (rPerms & pMODIFY) == pMODIFY );
}
}
=================
You can use this to determine any permission set for the object. I have a global variable section declared that sets pEDITPERMS=LAPI_DOCUMENTS.PERMS_EDITPERMS, etc., just for ease sake.
Hope this helps!