Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
UserGroups to which Users belong
GPB
I would like to determine how to list the various UserGroups to which a currently logged in User is associated in Windows environment?
Find more posts tagged with
Comments
Michael
Hi there
Welcome to the devnet forums -- just so you know, it is helpful to include some basic information about your environment on your posts - relevant versions etc... eg TS6.0 on W2K Server SPx, OD 5.6 SP1...
In response to your question, where and why would you like to do this? In a workflow, on a presentation template, in an inline script, in a callout, in formAPI?
Cheers
Michael
GPB
Hello Michael,
Thanks for the tip. Here is a complete problem statement:
I am currently using TS6.1(with SP1) installed on Win2003 server. I would like to list the various UserGroups to which a currently logged in User is associated in Windows environment(In a CGI callout). Is this possible and if so how(a sample code snippet would help :-) ). Based on UserGroup certain controls are shown/hidden to the User. I know that it is possible in Solaris.
GPB
Michael
Hi
Nice post!
More questions sorry -- is your CGI callout implemented in perl? Are the user and groups in question local to the server and/or are these domain users and groups?
Cheers
Michael
Dwayne
Take a look at
perdoc Win32API::Net
and
perldoc Win32::NetAdmin
for some Perl modules designed to inplement these sorts of queries
--
Current project: TS 5.5.2/6.1 W2K
GPB
Hello Micheal,
Yes the CGI is implemented in Perl and the Users in question refer to the domain users and groups.
GPB
screenshot.png
Michael
Excellent - Dwayne's post should be all you need then (I hope) - have a look at UserGetGroups() in Win32API::Net perhaps and post again if you get stuck.
Cheers
Michael
Migrateduser
If all your users are in Active Directory, you could also approach the problem using Net::LDAP.
Johnny
So how bout Java then?
Do you have to resort to 3rd party api's or your own JNI wrappers.
CSSDK seems to have methods for retrieving file permissions which is great, but I haven't seen anything about users.
So half of the puzzle is missing somewhere.
The TeamSite UI's must be retrieving this info somehow.
John Cuiuli
Migrateduser
Java intrinsically does not have classes to help you there. You would need your own JNI wrappers with OS specific implementations to get the UserGroup info. CSSDK currently does not have methods to get this info.
The way TeamSite UI works is to check whether the current user has permissions on a particular object in TeamSite or not. If the user is the owner of a workarea/branch/workflow or if he/she belongs to a group that has access to the object, then the user has permission, else no access. The javadocs have detailed description of methods that can be used for various objects
Hope this helps.
Best Regards,
Narendra
Migrateduser
I don't know how much work it is in JNI, but you could also shell out to a command line tool, possibly with performance issues. The code should branch based on OS since the command and results may differ by platform (I think on Windows you need the Resource Kit and it's showgrps or something, on Unix it's groups). I probably have this code for Windows if needed.
But, I am also interested in how Interwoven retrieves this internally. I bet it is in the C/C++ code.
Edited by john on 09/14/04 08:49 AM (server time).
Johnny
Thanks for the info Narendra.
From what you are writing you seem to mention that CSSDK does not provide... then you mention that it may.
?
Can you point where in the Javadocs, as you mentioned, how you can check whether the current user will have permission for workarea/branch/workflow
John Cuiuli
Johnny
Does anyone know of any good open/commerical 3rd party libraries that allow access to the windows domain ACL's?
John Cuiuli
Migrateduser
Hi John,
There are methods like CSBranch.isReadable(), CSBranch.getWorkareasForUser(), CSBranch.getWorkareasOwnedByUser(), CSWorkarea.isReadable(), CSWorkarea.isWritable(), CSFile.isReadable(), CSFile.isWritable(), CSFile.getPermissions() (will get you the windows ACLs, and on Solaris will return the permission string - -rwxrwxrwx).
For workflows, you can form queries to get only tasks/workflows that are owned by a particular user (methods - CSWorkflowEngine.getWorkflowsByQuery(), CSWorkflowEngine.getTasksByQuery()).
Hope this helps.
Best Regards,
Narendra
Johnny
Wow, thanks for that... I didn't interpret them as being related to OS ACL, but it makes perfect sense!
Looks like there still would be some need to for example directly list users from a group.
Will look to see what is out there.
John Cuiuli