10-01-2009 9:55 PM
HI All ,
I have to provide new class which can provide the user assignments to roles .
the user assignments to roles need be provided to by CSV file to on the server .
i want to run on all the users with bapi get details .
i need help in thinking on edge case .
Regards
Nina
10-02-2009 1:17 AM
Hi,
I would define a class with the attributes username and table of roles and the following simple methods:
static method getUser - parameter username
It would simply return a object with stored user name and all roles assigned to this user using BAPI BAPI_USER_GET_DETAIL or throw exception user does not exist.
method addRole - parameter role. This method would simply add role into list of roles.
method removeRole - parameter role. This method would simply remove role into list of roles.
method storeUser - this method would commit changes to DB using BAPI BAPI_USER_ACTGROUPS_ASSIGN and BAPI_USER_ACTGROUPS_DELETE.
After you implement this basic class you can add additional methods like getRolesFromFile which would read and parse CSV file and use methods removeRole and addRole.
Cheers
10-02-2009 1:17 AM
Hi,
I would define a class with the attributes username and table of roles and the following simple methods:
static method getUser - parameter username
It would simply return a object with stored user name and all roles assigned to this user using BAPI BAPI_USER_GET_DETAIL or throw exception user does not exist.
method addRole - parameter role. This method would simply add role into list of roles.
method removeRole - parameter role. This method would simply remove role into list of roles.
method storeUser - this method would commit changes to DB using BAPI BAPI_USER_ACTGROUPS_ASSIGN and BAPI_USER_ACTGROUPS_DELETE.
After you implement this basic class you can add additional methods like getRolesFromFile which would read and parse CSV file and use methods removeRole and addRole.
Cheers
10-02-2009 9:22 AM
HI Martin,
Thanks
What i need is to provide service which just provide the user assignments (GET )which already exist in the BE ,
i don't need to create new roles to user .
what i need is to know how to optimize the process i.e. after the initial load (send all the user with there assignments )
i want to calculate the the deltas and not to calculate all the the users .
i think that that i can do it with time stemp which i send to the caller, and one of the problem is how to know if the user is deleted from the list or if for some user some role are deleted from is list and etc .
What do u think i want to catch the edge cases ?
Regards
Nina
Edited by: Nina C on Oct 5, 2009 9:31 AM