Revision 61:e49003ea3063
src/main/java/my/com/upass/MinimalUPassControllerV2.java | ||
---|---|---|
13 | 13 |
import my.com.upass.pojo.ClientApp; |
14 | 14 |
import my.com.upass.pojo.ConfigurationBean; |
15 | 15 |
import my.com.upass.pojo.MinimalUserBean; |
16 |
import my.com.upass.pojo.UserAppAccess; |
|
16 | 17 |
import my.com.upass.services.AppAccessMgtService; |
17 | 18 |
import my.com.upass.services.AppAccessMgtService.MultipleAppAccessesFound; |
18 | 19 |
import my.com.upass.services.ChangeStaticPasswordService; |
... | ... | |
378 | 379 |
final String userAlias = user.getUserAlias(); |
379 | 380 |
|
380 | 381 |
int rc; |
381 |
try { |
|
382 |
tryCatch: try {
|
|
382 | 383 |
AccessCheckResult checkResult = checkAppAccess(appAccessId, hashedSecretKey, txSession); |
383 | 384 |
|
384 | 385 |
final Integer invokingAppId = checkResult.invokerAppId; |
... | ... | |
395 | 396 |
} else if (invokingAppId.intValue() != appIdForProfile) { |
396 | 397 |
permitted = false; |
397 | 398 |
} |
398 |
rc = permitted ? |
|
399 |
modifyUserService.updateProfileShallowly(profile, txSession) |
|
400 |
: MinimalConstants.ERR_APP_SERV_NOT_PERMITTED; |
|
399 |
if (!permitted) { |
|
400 |
rc = MinimalConstants.ERR_APP_SERV_NOT_PERMITTED; |
|
401 | 401 |
|
402 |
} else { |
|
403 |
boolean granted = appAccessMgtService.grantAppAccessToUser( |
|
404 |
profile.getMinUser().getUserID(), appIdForProfile, UserAppAccess.TYPE_USER, txSession); |
|
405 |
|
|
406 |
rc = granted ? |
|
407 |
modifyUserService.updateProfileShallowly(profile, txSession) |
|
408 |
: MinimalConstants.ERR_SYSTEM_NOT_READY; |
|
409 |
} |
|
402 | 410 |
} catch (MultipleAppAccessesFound e) { |
403 | 411 |
rc = MinimalConstants.ERR_APP_SERV_NOT_PERMITTED; |
404 | 412 |
e.printStackTrace(); |
Also available in: Unified diff