Search in sources :

Example 1 with UserRoleDTO

use of com.wso2telco.core.userprofile.dto.UserRoleDTO in project core-util by WSO2Telco.

the class UserProfileRetriever method getUserProfile.

public UserProfileDTO getUserProfile(String userName) throws BusinessException {
    log.debug("retrieve user profile for user : " + userName);
    UserRoleDTO userRoleDTO = userRoleRetriever.getUserRoles(userName);
    UserRolePermission uiPermissionBuilder = UserRolePermissionFactory.getInstance().getUserRolePermissionExecuter(UserRolePermissionType.UI_PERMISSION);
    Map<String, Object> uiPermissionTree = uiPermissionBuilder.build(userName);
    UserClaimProsser userClaimRetriever = new UserClaimProsser();
    UserClaimDTO userClaimDTO = userClaimRetriever.getUserClaims(userName);
    return fillUserProfileDTO(userName, userRoleDTO, uiPermissionTree, userClaimDTO);
}
Also used : UserRoleDTO(com.wso2telco.core.userprofile.dto.UserRoleDTO) UserClaimDTO(com.wso2telco.core.userprofile.dto.UserClaimDTO) UserClaimProsser(com.wso2telco.core.userprofile.prosser.UserClaimProsser) UserRolePermission(com.wso2telco.core.userprofile.permission.impl.UserRolePermission)

Example 2 with UserRoleDTO

use of com.wso2telco.core.userprofile.dto.UserRoleDTO in project core-util by WSO2Telco.

the class UserRoleProsser method getUserRoles.

public UserRoleDTO getUserRoles(String userName) {
    UserRoleDTO userRoleDTO = null;
    List<String> currentUserRoleList = getRolesByUserName(userName);
    if (!currentUserRoleList.isEmpty()) {
        String[] userRoles = new String[currentUserRoleList.size()];
        userRoles = currentUserRoleList.toArray(userRoles);
        userRoleDTO = new UserRoleDTO();
        userRoleDTO = fillUserRoleDTO(userRoles, userRoleDTO);
    }
    return userRoleDTO;
}
Also used : UserRoleDTO(com.wso2telco.core.userprofile.dto.UserRoleDTO)

Aggregations

UserRoleDTO (com.wso2telco.core.userprofile.dto.UserRoleDTO)2 UserClaimDTO (com.wso2telco.core.userprofile.dto.UserClaimDTO)1 UserRolePermission (com.wso2telco.core.userprofile.permission.impl.UserRolePermission)1 UserClaimProsser (com.wso2telco.core.userprofile.prosser.UserClaimProsser)1