amarquee.library/QSetKeyAccessOp amarquee.library/QSetKeyAccessOp
NAME
QSetKeyAccessOp - Set a path describing which other clients may
access a single data item of yours.
SYNOPSIS
#include
LONG QSetKeyAccessOp(struct QSession * session, char * path, char * newAccess)
FUNCTION
By default, any other AMarquee client may download your client's
data. But it may be that you only want to share your data with
certain clients. This function allows you to set an access
control path, in the form of "/hostExp/progExp", to specify
exactly which other AMarquee clients may look at your data item.
Clients that are not included in your access path will not
be notified when your data item is updated, and they will not see
your dataitem named 'path' in your directory via QGetOp(), either.
NOTE
If you specify an access pattern that excludes your own data(!),
you will not be able to read your data
(e.g. QGetOp("/myhost/myprog/mydata") and
QGetOp("mydata") will not return any QMessages
to you).
You can always QSetOp to your directory, no matter what.
If you have exluded a particular host via the QSetAccessOp() function then it won't
have any access to your dataitem even though you give it access via QSetKeyAccessOp().
So if you decide to have key oriented permissions then you probably would set QSetAccessOp()
to "/#?/#?" to let anybody access you data. Or don't set QSetAccessOp() at all. Then you
restrict access one and one on the keys in your path via this function.
INPUTS
session - The session you wish to send the access operation to.
path - The path or key which you want to restrict the access to.
newAccess - The new access pattern to use. Note that on startup,
the access pattern is "/#?/#?" (i.e. no restrictions
on access). If you have set the access on your data
tree with QSetAccessOp() then that access will be default.
RESULTS
Returns the assigned ID number of the access operation, or 0
to indicate failure. This function will fail and return 0 if
the "newAccess" arg is not in the form "/foo/bar".
NOTE
This function requires amarquee.library v49+.
EXAMPLE
LONG transID;
/* Let only programs named ExampleProgram see our dataitem named 'mykey' */
if (transID = QSetKeyAccessOp(session, "mykey", "/#?/ExampleProgram"))
printf("SetAccess op succeeded, was given id #%li\n",transID);
else
printf("SetAccess op failed. (no memory?)\n");
AREXX EXAMPLE
transID = QSetKeyAccessOp(session, 'mykey', '#?/ExampleProgram')
if (transID = 0) then say "Oops, transaction failed."
SEE ALSO
SetAccessOp, QGo, QGetOp, QSubscribeOp
Converted on 24 Mar 2002 with RexxDoesAmigaGuide2HTML 2.1e(private) by Michael Ranner.