Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
iwattrib - how do i use it to get workarea name?
Snoop
In my IPL(Perl) file, I am trying to capture the current user's workarea name. I tried using iwattrib, but it only returned the userid of the user.
use CGI qw(:standard);
&CGI::ReadParse;
my $user = $in{user_name};
Is there a way I can use iwattrib to get the workarea of the user?
Thanks in advance,
Mehul
Find more posts tagged with
Comments
Migrateduser
What exactly do you mean by
I am trying to capture the current user's workarea name
? In what context are you in when you are running your perl script? Is it an externaltask script? If so, your point is moot. Is it a custom menu item script? If so, again your point is moot.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
tvaughan
If you are doing the same kind of thing that I am, in that the username is the same of the WORKAREA name, then within custom menu items, you can use the {form}{"user"} or the {form}{"directory_path"} to figure out where the user is and who the user is.
If you're in some arbitrary perl script running somewhere and you want to get a mapping between users and "workareas they inhabit", you're going to have to develop some kind of hash table on your own.
Actually, that brings up an interesting thought --- when a user first logs on and clicks their "Workarea" button, they are presented with a list of all workareas in the system for which they have write access. I wonder how TeamSite does that, and if it has some open access to that functionality . . . . . probably not.
Well, if anyone out there is bored and wants to write such a utility, I'd give them props for posting it here.
Tom
Migrateduser
That's a really good point - this functionality should be exposed somehow. Unfortunately I think for FrontOffice you have to maintain a config file to map users to the workareas they have access to, so if it the functionality were available I don't see why they would have to do that (I would have implemented the reverse - let FrontOffice map to any workarea they have access to using this functionality, except the ones listed in the config file). So I doubt it is availble, but since it's in TeamSite it must have been coded.
I think if the functionality is not exposed a utility that would do it might have to be a scheduled process to write a config file, because it seems like it would be pretty expensive to run it interactively (recurse the filesystem?). Then apps would have to query the config file. Would I get mad props or just props for writing this? I imagine it might be OS-specific.
tvaughan
I don't know about "mad" props -- I don't just go handing those out like so much candy. I guess it would depend on the beast-quotient of your script.
I'm thinking that creating a script that would return a list of WORKAREA vpaths a given user has access to might not be that bad. Most installations I've worked on keep a list of the branches in an
@array
or flat file for use in all sorts of global operations.
You could 'ls' each subdir under each $branch/WORKAREA and check to see if the user in question is either the user owning that workarea, or in the group owning that x7x workarea.
Not too hard, but I'm about to go on a boondoggle to New Orleans for 2 days, so I'll leave this as an exercise to the reader.
Tom
Adam Stoller
We seem to have gotten off on a tangent here - Snoop - did you get your question answered? If not - could you please provide a bit more context for where / how / when this script you're trying to write gets run?
--fish
(Interwoven Senior Technical Consultant)