cancel
Showing results for 
Search instead for 
Did you mean: 

what is Iuser?

Former Member
0 Kudos

Hi Gurus,

what is Iuser?

what is the use of it?

Thanks in Advance,

Dharani

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

IUserfactory provides means to instantiate user objects,create users,delete users ,search for users based on different criteria.

Acccess to user factory can be obtained using following packages

import com.sap.security.api;

IuserFactory userfact=UMFactory.getUserFactory();

Methods are provided to instantiateuser objects given a login id

IUserFactory userfact=UMFactory.getUserFactory();

getUserFactory().getUser(String uniqueid);

get the user with login id

getUserFactory.getUser(string uniqueid,AttributeList attrlist)

The IUser object contains most the information that you probably need regarding a user. Information about the name of the user, their unique ID, LDAP attributes,display name, role membership, etc are available from the IUser object.

Thanks,

Tulasi

Former Member
0 Kudos

Hello Dharani,

IUser is a public interface under com.sap.security.api package and it is present in com.sap.security.api.jar file. This jar file you can get if you have installed NWDS (Netweaver development studio).

This interface provides read-access to the user's attributes, and offers basic support for authorization checking. Implementations of this interface must make sure that all get-methods with a return type of String, e.g. getFax(), getCompanyId() etc. return null if that attribute either does not exist or has a null value in the user store. This does NOT apply to the generic getAttribute...() methods.

This interface mainly delas with user details, to get all users, to get user info, etc.

Refer to following snippet of java code:



try {
			IUserFactory uf = UMFactory.getUserFactory();
			ISearchResult result = uf.getUniqueIDs();
			while (result.hasNext()) {
				String uniqueid = result.next().toString();
				IUser user = uf.getUser(uniqueid);
				String userid = user.getUniqueName();
				//response.write("<BR>"+ uniqueid + " "+ user + "  "+ userid+" <BR>");
				response.write("<BR>"+ userid+" <BR>");
			}
		} catch (UMException um) {
			response.write("In Catch : <BR>");
			response.write("excp is " + um.toString());
		}

also refer to following links for more clear understanding:-

https://www.sdn.sap.com/irj/sdn/thread?messageID=5428797#5428797

https://www.sdn.sap.com/irj/sdn/thread?messageID=5312444#5312444

Hope this solves your query...

Regards,

Yogesh

Former Member
0 Kudos

hiii Dharani..

use this link , it contain lot off information http://help.sap.com/javadocs/NW04S/current/se/com/sap/security/api/package-summary.html.

Give rewards if usefull for u.

Regards

Mayank saxena.