+ };
+ // confAdminSt.open();
+ KernelUtils.asyncOpen(confAdminSt);
+ }
+
+ private void addStandardSystemRoles(UserAdmin userAdmin) {
+ // we assume UserTransaction is already available (TODO make it more robust)
+ UserTransaction userTransaction = bc.getService(bc.getServiceReference(UserTransaction.class));
+ try {
+ userTransaction.begin();
+ Role adminRole = userAdmin.getRole(NodeConstants.ROLE_ADMIN);
+ if (adminRole == null) {
+ adminRole = userAdmin.createRole(NodeConstants.ROLE_ADMIN, Role.GROUP);
+ }
+ if (userAdmin.getRole(NodeConstants.ROLE_USER_ADMIN) == null) {
+ Group userAdminRole = (Group) userAdmin.createRole(NodeConstants.ROLE_USER_ADMIN, Role.GROUP);
+ userAdminRole.addMember(adminRole);
+ }
+ userTransaction.commit();
+ } catch (Exception e) {
+ try {
+ userTransaction.rollback();
+ } catch (Exception e1) {
+ // silent
+ }
+ throw new CmsException("Cannot add standard system roles", e);
+ }
+ }
+
+ private void loadIpaJaasConfiguration() {
+ if (System.getProperty(KernelConstants.JAAS_CONFIG_PROP) == null) {
+ String jaasConfig = KernelConstants.JAAS_CONFIG_IPA;
+ URL url = getClass().getClassLoader().getResource(jaasConfig);
+ KernelUtils.setJaasConfiguration(url);
+ log.debug("Set IPA JAAS configuration.");
+ }