public String[] getRoleListOfUser(String userName) throws UserStoreException { try { return stub.getRoleListOfUser(userName); } catch (Exception e) { handleException(e.getMessage(), e); } return null; }
@Override public String[] getRoleListOfUser(String userName) throws UserStoreException { try { return stub.getRoleListOfUser(userName); } catch (Exception e) { handleException(e.getMessage(), e); } return new String[0]; }
/** * Query the remote user manager and retrieve the list of role names associated for the given * user name. This is used when authorization for certain actions are appropriately delegated * to other components (ex:- Lifecycle Management). * * @param user Username * @return the list of roles to which the user belongs to. * @throws org.wso2.carbon.appmgt.api.AppManagementException If and error occurs while accessing the admin service */ public String[] getRolesOfUser(String user) throws AppManagementException { CarbonUtils.setBasicAccessSecurityHeaders(username, password, true, userStoreManager._getServiceClient()); if (cookie != null) { userStoreManager._getServiceClient().getOptions().setProperty(HTTPConstants.COOKIE_STRING, cookie); } try { String[] roles = userStoreManager.getRoleListOfUser(user); ServiceContext serviceContext = userStoreManager. _getServiceClient().getLastOperationContext().getServiceContext(); cookie = (String) serviceContext.getProperty(HTTPConstants.COOKIE_STRING); return roles; } catch (Exception e) { throw new AppManagementException("Error while accessing backend services for " + "user role list", e); } }