}
}
public UserStoreInfo getUserStoreInfo() throws UserAdminException {
try {
RealmConfiguration realmConfig = realm.getRealmConfiguration();
UserStoreInfo info = new UserStoreInfo();
if ("true".equals(realmConfig
.getUserStoreProperty(UserCoreConstants.RealmConfig.PROPERTY_READ_ONLY))) {
info.setReadOnly(true);
} else {
info.setReadOnly(false);
}
info.setPasswordsExternallyManaged(realmConfig.isPasswordsExternallyManaged());
info.setJsRegEx(realmConfig
.getUserStoreProperty(UserCoreConstants.RealmConfig.PROPERTY_JS_REG_EX));
info.setUserNameRegEx(
realmConfig.getUserStoreProperty(UserCoreConstants.RealmConfig.PROPERTY_USER_NAME_JS_REG_EX));
info.setRoleNameRegEx(
realmConfig.getUserStoreProperty(UserCoreConstants.RealmConfig.PROPERTY_ROLE_NAME_JS_REG_EX));
info.setExternalIdP(realmConfig.
getUserStoreProperty(UserCoreConstants.RealmConfig.PROPERTY_EXTERNAL_IDP));
MessageContext msgContext = MessageContext.getCurrentMessageContext();
HttpServletRequest request = (HttpServletRequest) msgContext
.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
HttpSession httpSession = request.getSession(false);
if (httpSession != null) {
String userName = (String) httpSession.getAttribute(ServerConstants.USER_LOGGED_IN);
if (realm.getAuthorizationManager().isUserAuthorized(userName,
"/permission/admin/configure/security",
CarbonConstants.UI_PERMISSION_ACTION)) {
info.setAdminRole(realmConfig.getAdminRoleName());
info.setAdminUser(realmConfig.getAdminUserName());
info.setEveryOneRole(realmConfig.getEveryOneRoleName());
info.setMaxUserListCount(Integer.parseInt(realmConfig
.getUserStoreProperty(UserCoreConstants.RealmConfig.PROPERTY_MAX_USER_LIST)));
}
}
info.setBulkImportSupported(this.isBulkImportSupported());