cancel
Showing results for 
Search instead for 
Did you mean: 

portal user properties changing

Former Member
0 Kudos

Hi,all

How can I get the prtal user for changing his properties?

I know how to change user password for examole:

IUserAccount iuacc = UMFactory.getUserAccountFactory().getUserAccountByLogonId(userName);

IUserAccount account = UMFactory.getUserAccountFactory().getMutableUserAccount(iuacc.getUniqueID());

userName I have,

and after that I can set a new password for him:

account.setPassword(password);

account.setPasswordChangeRequired(false);

account.save();

account.commit();

And what I need is to change his email,telefon .

How I get specified user for update?

Regards,

Michael

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Michael,

Use IUserMaint API to get <i><b>write</b></i> access to a user.


try 
{
     final IUserFactory userFactory = UMFactory.getUserFactory();
     IUser user = WDClientUser.getCurrentUser().getSAPUser();
     IUserMaint userMaintData = userFactory.getMutableUser(user.getUniqueID());
     userMaintData.setCellPhone("1234");
     userMaintData.setEmail("a@b.com");
     userMaintData.commit();
} 
catch (UMException e) 
{
     e.printStackTrace();
}
catch(WDUMException e)
{    		 
     e.printStackTrace();
}

Bala

Former Member
0 Kudos

Bala,thanks for your reply,but I need to get specific user by his username.

Where I put the username in your code?

Regards,

Michael

Former Member
0 Kudos

Use this.


try {
	final IUserFactory userFactory = UMFactory.getUserFactory();
	// Specify the Logon id of the user here in the next line
	IUser user = UMFactory.getUserFactory().getUserByLogonID("<log on id of user>");
	IUserMaint userMaintData = userFactory.getMutableUser(user
					.getUniqueID());
        userMaintData.setCellPhone("1234");
	userMaintData.setEmail("a@b.com");
	userMaintData.commit();
			
} catch (UMException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
}

Bala

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Michael,

to solve this issue you must perform two steps:

STEP ONE (on EP)

System Administration -> System Configuration -> Data Sources

Download the file dataSourceConfiguration<XXX>.xml and set the tag <dataSource> attribute isReadonly="false"

System Administration -> System Configuration -> SAP System

Check Backend data to wich UME connect to and register the user id (such as SAPJSF_<SID>), that is the user that access from the portal to backend to access to the user data

STEP TWO (on backend SU01)

Insert the user id registered before and check these assigned roles:

- "SAP_BC_JSF_COMMUNICATION_RO" then from the EP will be possibleto access to User Data in Read Only mode

- "SAP_BC_JSF_COMMUNICATION" then from the EP will be possibleto access to User Data in Write/Read mode

After the role assign generate the Authorization Profiles properly.

Finally restart the J2EE Engine.

Per more info about the user configuration please read:

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/8f/67d27676ace84080964d4c4223bb3c/content.htm">http://help.sap.com/saphelp_nw04/helpdata/en/8f/67d27676ace84080964d4c4223bb3c/content.htm</a>

Reward points for helpful answers.

Best regards,

Gianluca Barile