[alicebot-developer] Conversation restrictions based on user id

David Sienkiewicz alicebot-developer@list.alicebot.org
Tue, 23 Nov 2004 14:08:52 -0500


I've been working on trying to obtain as much information about the user 
without asking a question.
Here's a REXX code fragment that shows the beginning of my solution:

call outtrap "lu."; "lu"; call outtrap "off"; fi=word(lu.1,3); drop lu.
fi=formal(fi); uid=userid()

To gain access to my program, a user logs into the Time Sharing Option 
application and is authenticated by the Resource Access Control Facility. 
The user has been predefined in the security system by the system 
administrator where all access rights and privledges are determined for that 
user. Usually not common knowledge, a user can list their access rights with 
an LU command to see what they are allowed to do. I can imbed this command 
in my program's initialization and capture the results, parse it, and then 
perhaps use the information to direct the conversation.

What the first call to outtrap does is create a "stemmed" variable that 
accepts output data from a command now being directed to a stack. I execute 
the List User command and all of its output is directed into the stack. 
Executing the outtrap, "off", closes the stemmed variable and redirect the 
output back to normal (the display). The output from the lu is typically 
typed over multiple lines, each line represented by an element number. An 
element number of 0 would tells us how many lines of output the lu command 
generated.

The next statement says get the third word found in line 1, which will 
always be the users first name. At this point in the example, I delete the 
LU stem, but I could continue and extract the rights and privledges 
information. I'll code something in the future to take advantage of it's 
availability here.

The formal function just insures the first name is formalized per the AIML 
standard. I also have a function that picks up the 8 character userid in 
case I need it. So, now I have the userid, user first name, and any optional 
security definitions I care to use. I'll have to decide now what AIML 
modifications are needed to identify the level of access allowed to a topic 
and that will let me tailor the conversation to that particular individual.

Thanks everyone.
Dave S.