Revision 62:830f5a025c2b

View differences:

src/main/java/my/com/upass/MinimalUPassControllerV2.java
184 184
	 * This methods identifies the target app using <code>appAccessId</code>,
185 185
	 * hence meant for {@link ClientApp}s
186 186
	 * 
187
	 * @see #addUser(String, String, MinimalUserBean, char, int, Session, boolean)
187
	 * @see #addUser(String, String, MinimalUserBean, Character, Integer, Session, boolean)
188 188
	 */
189 189
	public int addUser(
190 190
			String appAccessId, String hashedSecretKey, MinimalUserBean user,
......
205 205
				user.setUserType(MinimalConstants.UTYPE_STATE_USER);
206 206
				user.setPstate(MinimalConstants.UID_STATE_ACTIVE);
207 207
				rc = createUserAndGrantAccessToApp(
208
						user, appId.intValue(), accessType, txSession, checkPassword);
208
						user, appId, new Character(accessType), txSession, checkPassword);
209 209
			}
210 210

  
211 211
		} catch (UPassException e) {
......
221 221
	}
222 222

  
223 223
	private int createUserAndGrantAccessToApp(
224
			MinimalUserBean user, int appId, char accessType,
224
			MinimalUserBean user, Integer appId, Character accessType,
225 225
			Session txSession, boolean checkPassword) {
226 226

  
227 227
		int rc;
......
229 229
				createUserService.addUser(user, txSession, checkPassword);
230 230

  
231 231
		rc = creationResult.getCode();
232
		if (rc == MinimalConstants.ERR_SUCCESS) {
232
		if (rc == MinimalConstants.ERR_SUCCESS && appId != null) {
233 233
			final long userId = creationResult.getUserId().longValue();
234 234
			boolean granted = appAccessMgtService.grantAppAccessToUser(
235
					userId, appId, accessType, txSession);
235
					userId, appId.intValue(), accessType.charValue(), txSession);
236 236

  
237 237
			rc = granted ?
238 238
					MinimalConstants.ERR_SUCCESS
......
249 249
	 */
250 250
	public int addUser(
251 251
			String adminUsername, String adminPassword, MinimalUserBean user,
252
			char accessType, int targetAppId, Session txSession, boolean checkPassword) {
252
			Character accessType, Integer targetAppId, Session txSession, boolean checkPassword) {
253 253

  
254 254
		final String userAlias = user.getUserAlias();
255 255
		int rc;

Also available in: Unified diff