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
setObjectRights
MARMCL01User2_(Delete)_2732404
Please refer to the attached image file...If I set an ojects permissions to 'Reserve' through the web interface then all the required parent permissions are also set (see right side of image). If I set the same object's permission to 'PERM_CHECKOUT' through a LAPI call then only the 'Reserve' permission is set. Is the LAPI functioning correctly? If so, how does one set the other permissions for the same user/group? It seems that 'RIGHT_UPDATE' replaces the currrent permissions instead of updating them.We have Livelink 9.1.0 installed on a WinNT 4 server.Any insight would be appreciated,Dave
Find more posts tagged with
Comments
eLink User
Message from Sean M Alderman via eLinkI just had to open a ticket on this a few weeks ago. The suggestedprocedure for modifying permissions via lapi was to callgetObjectRights() first and then use that permission set and | it withthe PERM_ that you want to set. LAPI uses a single integerfield to store permissions, so bitwise operations are in order here. For example if it was an 8 bit integer...these numbers are hypothetical!!!PERM_SEE = 0000 0001PERM_SEECONTENTS = 0000 0010PERM_CHECKOUT = 0010 0000... and so on...So if you did a GetObjectRight() and it returned 0000 0011 and youwanted to add PERM_CHECKOUT, it would go like this -0000 0011 | 0010 0000 = 0010 0011and use that as your perms param with RIGHT_UPDATE for SetObjectRight ifyou wanted to preserve the existing permission set.>From the tech that answered my ticket...> RIGHT_DELETE deletes the entire permission set for that user. It is > for removing permissions on an object for a user. RIGHT_ADD adds a> permission set for a user, hence giving the user permissions on the> object. RIGHT_UPDATE doesn't differentiate, it simply sets the perms> to whatever you specify.So the RIGHT_<...> constants refer to the user/group in question -ADD -> user/group does not exist in the aclUPDATE -> user/group does exist in the aclDELETE -> removes user/group in the acl (regardless of what perm set ispassed in).With Add and Update a complete permission set must be passed in, notjust a single PERM_<...> constant.My actual preference is a little more complicated... If I know what thepermissions should be, then I use the PERM_FULL & !( setObjectRights> Posted by MARMCL01User2 on 06/04/2002 10:27 AM> > Please refer to the attached image file...> > If I set an ojects permissions to 'Reserve' through the web interface then all the required parent permissions are also set (see right side of image). If I set the same object's permission to 'PERM_CHECKOUT' through a LAPI call then only the 'Reserve' permission is set. Is the LAPI functioning correctly? If so, how does one set the other permissions for the same user/group? It seems that 'RIGHT_UPDATE' replaces the currrent permissions instead of updating them.> > We have Livelink 9.1.0 installed on a WinNT 4 server.> > Any insight would be appreciated,> Dave> > [To reply to this thread, use your normal e-mail reply function.]> > ============================================================> > Attachment link: permission.gif>
https://knowledge.opentext.com/knowledge/livelink.exe/2755272/permission.gif?func=doc.Fetch&nodeid=2755272>
; > ============================================================> > Discussion: LAPI Discussion>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=765428&objAction=view>
; > Livelink Server:>
https://knowledge.opentext.com/knowledge/livelink.exe>
; > -- Sean M. AldermanITRACK Systems AnalystPACE/NCI - NASA Glenn Research Center(216) 433-2795Calling a windowed operating system "Windows" is like naming anautomobile "Wheels."
MARMCL01User2_(Delete)_2732404
Sean,Thanks, I have it figured out now. I used your idea of subtracting from the PREM_FULL constant to generate the value of the permission set.documents.PERM_FULL - (documents.PERM_DELETEVERSIONS + documents.PERM_CHECKOUT +documents.PERM_DELETE) - documents.PERM_EDITPERMSI also see how I can modify an existing permission set using its current value.thanks,Dave
eLink User
Message from Sean M Alderman via eLinkDave, Be careful about confusing a mathematical subtraction and a bitwisesubtraction. This screwed with me a little when I was first figuringthings out. Each bit in the number represents a specific permission, soconditions that force borrows and carries cause problems by unsettingsomething. A mathematical subtraction will not always produce thedesired results. That's why I used the comliment (!) and (&) method. For example:taking a couple of 4 bit numbers -Math subtract ( - ) Bitwise Compliment/And ( & !(x)) 1111 = 15 1111 -> 1111 = 15 -0110 = 6 & !0110 -> &1001 = 9------ ---- ------- ---------- 1001 9 1001 = 9This works... but!... 1101 = 13 1101 -> 1101 = 13 -0111 = 7 & !0111 -> &1000 = 8------ ---- ------- ---------- 0110 6 1000 = 8So you can see how when you have a full permission set simple mathematicsubtraction works to produce the same answer, but if you have anincomplete permission set, and you want to take away several permissions(which might not be set to begin with, as the case with the 2nd bit fromthe right) a simple subtract won't work.Similarly, mathematical add ( + ) will not always work when adding apermission to a set. The bitwise OR ( | ) is a better choice. If youmathematically add any permission to a full set you could overflow(depending on how the language handles it), for example -Full Perms + PERM_SOMETHING...should be equal full perms, but only withan OR ... 1111 1111 + 0010 | 0010------- ------(1)1111 1111 ^ causes a carry. ^ 1 OR 1 is 1, no carry.On Tue, 2002-06-04 at 13:38, eLink Discussion: LAPI Discussion wrote:> Sean,> Posted by MARMCL01User2 on 06/04/2002 01:35 PM> > Sean,> > Thanks, I have it figured out now. I used your idea of subtracting from the PREM_FULL constant to generate the value of the permission set.> > documents.PERM_FULL - (documents.PERM_DELETEVERSIONS + documents.PERM_CHECKOUT +documents.PERM_DELETE) - documents.PERM_EDITPERMS> > I also see how I can modify an existing permission set using its current value.> > thanks,> Dave> > [To reply to this thread, use your normal e-mail reply function.]> > ============================================================> > Topic: setObjectRights>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=2755271&objAction=view>
; > Discussion: LAPI Discussion>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=765428&objAction=view>
; > Livelink Server:>
https://knowledge.opentext.com/knowledge/livelink.exe>
; > -- Sean M. AldermanITRACK Systems AnalystPACE/NCI - NASA Glenn Research Center(216) 433-2795Calling a windowed operating system "Windows" is like naming anautomobile "Wheels."
MARMCL01User2_(Delete)_2732404
Ahhhh! You astronauts sure are smart. Thanks for the insight.regards,Dave
eLink User
Message from Sean M Alderman via eLinkOnly cause I ran across this myself...that's kind of why I opened thatticket up a while back! :)On Tue, 2002-06-04 at 15:16, eLink Discussion: LAPI Discussion wrote:> subtraction> Posted by MARMCL01User2 on 06/04/2002 03:10 PM> > Ahhhh! You astronauts sure are smart. Thanks for the insight.> > regards,> Dave> > [To reply to this thread, use your normal e-mail reply function.]> > ============================================================> > Topic: setObjectRights>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=2755271&objAction=view>
; > Discussion: LAPI Discussion>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=765428&objAction=view>
; > Livelink Server:>
https://knowledge.opentext.com/knowledge/livelink.exe>
; > -- Sean M. AldermanITRACK Systems AnalystPACE/NCI - NASA Glenn Research Center(216) 433-2795Calling a windowed operating system "Windows" is like naming anautomobile "Wheels."