Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
CSIDE and OScript
Checking for membership of a group
Jason_Webb_(eu0023304_-_(deleted))
Hi all,I need to work out if the logged in user is a member of a given (named) group in LL 9.6.Is there an easy way to do this?If not then I need to get the ID of the currently logged in user so I can call UAPI.RightsListByID I don't want to call UAPI.GetUser as that is marked as depracted in the documentation.At the moment I get the current user name by callingcurrentUserName = request.prgCtx.fUSession.fUserNamebut ID or fID doesn't work for fUSession and I can't find a list of the keys on fUSession anywhere.
Find more posts tagged with
Comments
Chris_Bowman_(spawaruser1_-_(deleted))
Message from Chris Bowman via eLinkThe easiest way to find the key of a record or Assoc is to echo out therecord/Assoc. The first section of the echo will list the keys, revealingall available fields.Chris BowmanTechnical SpecialistSPAWAR SSC Pensacola130 West Ave, Suite DPensacola, FL 32508Office: 850.452.7684DSN: 922.7684Cell: 850.776.9353Email: cbowman@spawarpens.navy.mil-----Original Message-----From: eLink Discussion: Livelink Builder Discussion[mailto:componentbuilder@elinkkc.opentext.com] Sent: Monday, July 30, 2007 5:59 AMTo: eLink RecipientSubject: Checking for membership of a groupChecking for membership of a groupPosted by Webb, Jason on 07/30/2007 06:49 AMHi all,I need to work out if the logged in user is a member of a given (named)group in LL 9.6.Is there an easy way to do this?If not then I need to get the ID of the currently logged in user so I cancall UAPI.RightsListByID I don't want to call UAPI.GetUser as that is marked as depracted in thedocumentation.At the moment I get the current user name by callingcurrentUserName = request.prgCtx.fUSession.fUserNamebut ID or fID doesn't work for fUSession and I can't find a list of the keyson fUSession anywhere.[To reply to this thread, use your normal E-mail reply function.]============================================================Discussion: Livelink Builder Discussion
https://knowledge.opentext.com/knowledge/llisapi.dll/open/765419Livelink
Server:
https://knowledge.opentext.com/knowledge/llisapi.dllTo
Unsubscribe from this Discussion, send an e-mail tounsubscribe.componentbuilder@elinkkc.opentext.com.
Jason_Webb_(eu0023304_-_(deleted))
Yeah I thought so tooIt killed the LL server (and debugger) dead with an access violation.I didn't bother persuing it any further as I assumed this was LL's way of saying "don't do that - it hurts"
Donna Nalls
Hi Jason,I do not have LL 9.6, but have tested the following in LL 9.7 and it works fine:// testingobject uSession = request.prgCtx.fUSessiondynamic uGroupsif isDefined(uSession) && !isError(uSession) uGroups = UAPI.RightsListByID(uSession.fSession, uSession.fUserId) if isError(uGroups) dynamic check = error.ErrorToString(uGroups) endend// end testingCan you put a breakpoint on your script and inspect the value of request.prgCtx.fUSession?? Maybe you have encountered an LL 9.6 bug - do you have another version to test your code??Donna
Jason_Webb_(eu0023304_-_(deleted))
That was the missing piece of the puzzle.I only have 9.6 here but as I now have a solution I'm not inclined to look at the access violation unless some one from Opentext is interested in my possibly sloppy programming.
Donna Nalls
I doubt your programming was sloppy....more likely that Livelink was being tempermental --- that's our story and we're sticking' to it!!! ;o)best,donna
eLink User
Message from Carsten Kulms via eLinkby the way a tipp: Generally it is safer to use the correspondingfunctions to retrieve e.g. the user session.----8<--------8<--------8<--------8<----PrgSession ObjectWhen a Livelink user logs in, Livelink generates a PrgSession object,which is also called a program session object, for the user.The PrgSession object is a placeholder object that allows you to accessthe other session objects that are created during a Livelink session.For example, you can access the DbConnect object from the PrgSessionobject's fDbConnect feature, the UapiSession object by calling thePrgSession object's USession() method, the DapiSession object by callingthe PrgSession object's DSession() method, and the WapiSession object bycalling the PrgSession object's WSession() method.----8=--------8=--------8=--------8=---- [Livelink Module Developer's Guide: Reference Area - Session Objects]
Jason_Webb_(eu0023304_-_(deleted))
I have now read that section :)Another question though.How do I get the PrgSession when there doesn't seem to be one?I need to invoke my global method to work out if a user has rights to see a given button in a ProcessMultiSelect module (copy, move,delete). If they have no rights to see the button (our license limit) then they don't see the button.However function Boolean IsEnabled() doesn't seem to have access to the prgctx. Any ideas?
sıɹɥɔ
Message from Chris Webster <
cwebster@opentext.com
> via eLink
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">eLink
Hi Jason,
In Livelink 9.5 the IsEnabled function of MultiSelectModule is not passed a prgctx. If you are certain that this script will only be called by a request handler (which seems reasonable) then you can use
$WEBDSP.RequestHandlerSubsystem.GetCurrentPrgSession()
to access it.
In Livelink 9.7 the IsEnabled function is passed 3 parameters, including the prgctx.
(By the way, in addition to mentioning the version of Livelink you're working on, it's a good idea to start a new thread for each new question.)
Hope this helps,
-chris
From:
eLink Discussion: Livelink Builder Discussion [mailto:componentbuilder@elinkkc.opentext.com]
Sent:
Monday, July 30, 2007 1:43 PM
To:
eLink Recipient
Subject:
Thanks Carsten
Thanks Carsten
Posted by
eu0023304
(Webb, Jason) on 07/30/2007 02:38 PM
In reply to:
RE Hi Jason,
Posted by eLink on 07/30/2007 09:25 AM
I have now read that section
Another question though.
How do I get the PrgSession when there doesn't seem to be one?
I need to invoke my global method to work out if a user has rights to see a given button in a ProcessMultiSelect module (copy, move,delete). If they have no rights to see the button (our license limit) then they don't see the button.
However
function Boolean IsEnabled()
doesn't seem to have access to the prgctx. Any ideas?
Jason_Webb_(eu0023304_-_(deleted))
Although this isn't an Oscar speech I'd like to thank everyone who has helped me out recently. We have integrated our document review product PleaseReview (www.pleasetech.com) with the main LL interface - a job that would have been very difficult with the help I had on this forum.-- JasonP.S. Chris is correct - a) I should have told you the LL version, and b) Once question per post is much easier to read