Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Node right permissions in livelink

Status
Not open for further replies.

smallredville

Programmer
Aug 18, 2008
115
SG
Node Right Permission for users

Technically by using o-script programming, i need to add or update the permissions for some child nodes in livelink.
Now please see the code below which a small part of my function:

if ( privilege == "edit" )

aNewPerms = Assoc.CreateAssoc()
aNewPerms.See = true
aNewPerms.SeeContent = true
aNewPerms.Modify = true
aNewPerms.EditAttr = true
aNewPerms.Create = false
aNewPerms.DeleteVer = false
aNewPerms.Delete = false

iNewPermsMask = $LLIAPI.NodeUtil.PermAssocToMask( aNewPerms )
if dbResult != 0
llnode.NodeRightUpdate (nodeTemp, request.PermType, UserID, aNewPerms ) // If the rightid(UserID) is present already then //it simply will update the permissions column in DtreeACL
else
llnode.NodeRightAdd (nodeTemp, UserID, aNewPerms ) // If the rightid is not present then //it simply will add a new row with rightid(UserID) and the permissions column in DtreeACL


I need to know, to update the node right permission do i need NodeRightUpdate, NodeRightAdd and or wat?

In what condition do i need to use NodeRightADD function under llnode of the module and when shall noderightupdate will be used? Actually here i am bit confused...will my above code will work? I have tried it but my code get failed i think..help me what shall i do?

Note that, i am not giving the permission or access to any user by UI..i need to give this programatically.

Thanks
SRV
 
I have not taken a look at the code but my past experience in oscript and livelink general wants me to tell you this.

The prgCtx is the key to all these operations.The prgCtx has encapsulated info on the login privs of the caller.

A node that is in dtreeacl can only be updated/added if the prgCtx contains the bitmask of EP or edit permissions.This can be found out programmatically.

If the caller of your program does not have it he/she cannot add or update the permissions.So in very "rare" cases oscript code uses an 'Admin' context which should be set to null as soon as the special operation is done.The code is usually in the livelink builder if you search for "GimmeAprgCtx" it probably will show up.It actually creates a new prgCtx on the fly as 'Admin'.Like I said this should ONLY ber used very controlled and should be destroyed as soon as one does what one needs to do.


Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937

Certified OT Developer and probably certfiable,Livelink ECM Champion 2008
 
The names of the method should provide an outline of what they do :

NodeRightUpdate - To change an existing permissions set
NodeRightAdd - To add a new permissions set

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top