Package ch.entwine.weblounge.common.security

Examples of ch.entwine.weblounge.common.security.SystemDirectory


                // Make sure the system admin account is not shadowed
                if (site.getAdministrator() != null) {
                  ServiceReference userDirectoryRef = bundleContext.getServiceReference(SystemDirectory.class.getName());
                  if (userDirectoryRef != null) {
                    SystemDirectory systemDirectory = (SystemDirectory) bundleContext.getService(userDirectoryRef);
                    User siteAdmin = site.getAdministrator();
                    if (siteAdmin != null) {
                      logger.debug("Checking site '{}' admin user '{}' for shadowing of system account");
                      User shadowedUser = systemDirectory.loadUser(siteAdmin.getLogin(), site);
                      if (shadowedUser != null && SecurityUtils.userHasRole(shadowedUser, SystemRole.SYSTEMADMIN)) {
                        throw new IllegalStateException("Site '" + site.getIdentifier() + "' administrative account '" + siteAdmin.getLogin() + "' is shadowing the system account");
                      }
                    }
                  } else {
View Full Code Here

TOP

Related Classes of ch.entwine.weblounge.common.security.SystemDirectory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.