Package org.jayasoft.woj.common.services.security

Examples of org.jayasoft.woj.common.services.security.UnauthorizedException


        super(name);
    }

    protected void checkAuthorization(UAK uak, Map params) {
        if (!uak.isServer()) {
            throw new UnauthorizedException(uak, getName());
        }
    }
View Full Code Here


        super(name);
    }

    protected void checkAuthorization(UAK uak, Map params) {
        if (!uak.isAdmin()) {
            throw new UnauthorizedException(uak, getName());
        }
    }
View Full Code Here

                    LOGGER.debug("ModuleDescriptor successfully checked");

                    // check if user has right to publish at given visibility
                    if (uak.getPublishVisibilityRight().getId() < md.getVisibility().getId()) {
                        LOGGER.error("Impossible to publish to visibility: "+md.getVisibility()+" for user: " +uak.getUserName());
                        throw new UnauthorizedException(uak, "publish to visibility "+md.getVisibility());
                    }
                   
                    long moduleSize = computeModuleSize(zip);
                    md.setSize(moduleSize);
View Full Code Here

                    checkModuleDescriptor(md);
                    LOGGER.debug("ModuleDescriptor successfully checked");
                    // check if user has right to publish at given visibility
                    if (uak.getPublishVisibilityRight().getId() < md.getVisibility().getId()) {
                        LOGGER.error("Impossible to publish to visibility: "+md.getVisibility()+" for user: " +uak.getUserName());
                        throw new UnauthorizedException(uak, "publish to visibility "+md.getVisibility());
                    }

                    ModuleDescriptorDao dao = WOJServer.getInstance().getDataService().getModuleDescriptorDao();
                    ModuleDescriptor dbmd = dao.getModuleDescriptor(md.getOrganisation(), md.getModule(), md.getRevision(), uak.getUserId(), uak.getGroups(), md.getVisibility());
                    long size = computeModuleSize(zip);
View Full Code Here

            boolean checkIntegrity) {
   
        // check if user has right to publish at given visibility
        if (uak.getPublishVisibilityRight().getId() < visibility) {
            LOGGER.error("Impossible to publish to visibility: "+visibility+" for user: " +uak.getUserName());
            throw new UnauthorizedException(uak, "publish to visibility "+visibility);
        }
       
    // Ask for moduleDesc to ModuleManagementService.
        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug("Asking for ModuleDescriptor: " + modOrg + "|" + modName + "|" + modRev + " visibility: " + Visibility.fromInt(visibility));
View Full Code Here

    ModuleDescriptorDao dao = WOJServer.getInstance().getDataService().getModuleDescriptorDao();
    ModuleDescriptor md = dao.getModule(mdId);
    if (md != null) {
            if (!isVisibleFor(md, uak) && !uak.isAdmin()) {
                LOGGER.info("can't remove module: " + md.getModuleInfoAsString()+": not visible for "+uak);
                throw new UnauthorizedException(uak, "delete "+md.getModuleInfoAsString());
            }
            if (uak.getPublishVisibilityRight().getId() < md.getVisibility().getId()) {
                LOGGER.info("can't remove module: " + md.getModuleInfoAsString()+": no sufficient rights");
                throw new UnauthorizedException(uak, "delete "+md.getModuleInfoAsString());
            }
      dao.removeModuleDescriptor(md);
      WOJServer.getInstance().getContentService().refrechContentForModuleDescriptorDeletion(md);
      // Notification
      notifyModuleRemoved(md);
View Full Code Here

  private final static Logger LOGGER = LoggingManager.getLogger(AdminSecuredServlet.class.getName());

    protected void checkAuthorization(UAK uak, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        if (!uak.isAdmin()) {
          LOGGER.info(uak + "is asking for " + request.getRequestURL() + " with non admin rights !");
            throw new UnauthorizedException(uak, request.getServletPath());
        }
    }
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.common.services.security.UnauthorizedException

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.