Programmer's Guide to the wftk: working with role

[ wftk documentation home ] [ wftk programmer's guide home ]

Roles

A role is a named, well, role in connection with a process. The roles are defined by the procdef, but arbitrary roles may also be assigned as needed. A role, once assigned, ensures that tasks identified as belonging to particular roles will be assigned to the specified user when activated. In addition, there's obviously a documentation purpose as well, identifying some involved users by their function. Note that if a task is activated which doesn't identify a role, then the roles have no effect on it.

When the "procstart" action is taken by the wftk, a "Requester" role is assigned automatically to the user performing the procstart action. This usage of roles will probably be expanded in the future, so that there will be some number of system-standard roles (maybe "admin", for instance).

A role may be de-assigned either by assigning it a new user, or by passing it a blank string to denote that no user will own it.

Functions

int    wftk_role_list       (void * session, XML * datasheet, XML * list);
const char * wftk_role_user (void * session, XML * datasheet, const char * role);
int    wftk_role_assign     (void * session, XML * datasheet, const char * role, const char * userid);

Details

wftk_role_list returns int
void * session,
XML * datasheet,
XML * list
Lists the roles defined for a given process. Note that roles have meaning only within a process, so all the functions in the role API take a datasheet explicitly.

wftk_role_user returns const char *
void * session,
XML * datasheet,
const char * role
Names the user (if any) assigned to the named role. Creates the role if it wasn't there before.

wftk_role_assign returns int
void * session,
XML * datasheet,
const char * role,
const char * user
Assigns the named user to the named role. Creates the role if it wasn't already there; creates a user involvement entry if it wasn't already there. No authentication or verification of the username is performed; you're presumed already to have done that.





Copyright (c) 2001 Vivtek. Please see the licensing terms for more information.