Package de.iritgo.aktera.permissions

Examples of de.iritgo.aktera.permissions.PermissionManager


    if (permission == null)
    {
      return true;
    }

    PermissionManager permissionManager = (PermissionManager) SpringTools.getBean(PermissionManager.ID);
    boolean hasPermission = false;

    for (String p : permission.split("\\|"))
    {
      if (permissionManager.hasPermission(UserTools.getCurrentUserName(request), p))
      {
        hasPermission = true;

        break;
      }
View Full Code Here


  @Override
  public Object performWithResult()
  {
    String userName = properties.getProperty("userName");
    PermissionManager permissionManager = (PermissionManager) SpringTools.getBean(PermissionManager.ID);
    return permissionManager.hasPermission(userName, "de.iritgo.aktera.client.login");
  }
View Full Code Here

  {
    try
    {
      SystemConfigManager systemConfigManager = (SystemConfigManager) SpringTools.getBean(SystemConfigManager.ID);

      PermissionManager permissionManager = (PermissionManager) SpringTools.getBean(PermissionManager.ID);

      ModelResponse res = req.createResponse();

      boolean byGroups = NumberTools.toBool(req.getParameter("byGroups"), false);

      readConfig(req);

      int itemsPerRow = 3;

      if ("toolBar".equals(style))
      {
        itemsPerRow = 16;
      }

      String currentItem = (String) UserTools.getContextObject(req, "aktera.currentMenuItem");

      if (currentItem == null && UserTools.currentUserIsInGroup(req, "admin"))
      {
        currentItem = (String) systemConfigManager.get("system", "startMenuItemAdmin");
      }

      if (currentItem == null && UserTools.currentUserIsInGroup(req, "manager"))
      {
        currentItem = (String) systemConfigManager.get("system", "startMenuItemManager");
      }

      if (currentItem == null && UserTools.getCurrentUserId(req) != null)
      {
        currentItem = (String) systemConfigManager.get("system", "startMenuItem");
      }

      Output outFunctions = res.createOutput("functions");

      if (! byGroups)
      {
        outFunctions.setAttribute("style", style == null ? "none" : style);
        res.add(outFunctions);
      }

      String title = getConfiguration().getChild("title").getValue("functions");

      outFunctions.setAttribute("title", title);

      String bundle = getConfiguration().getChild("bundle").getValue("Aktera");

      outFunctions.setAttribute("bundle", bundle);

      Map<String, List<Command>> tmpMenuGroups = new Hashtable();

      int num = 0;

      for (Iterator i = functions.iterator(); i.hasNext();)
      {
        FunctionItem item = (FunctionItem) i.next();

        if (item.feature != null && ! LicenseTools.getLicenseInfo().hasFeature(item.feature))
        {
          continue;
        }

        if (item.check != null && ! CheckerTools.check(item.check, req, new Properties()))
        {
          continue;
        }

        if (item.role != null && ! UserTools.currentUserIsInGroup(req, "admin")
                && ! UserTools.currentUserIsInGroup(req, item.role))
        {
          continue;
        }

        if (item.permission != null)
        {
          boolean hasPermission = false;

          for (String p : item.permission.split("\\|"))
          {
            if (permissionManager.hasPermission(UserTools.getCurrentUserName(req), p))
            {
              hasPermission = true;

              break;
            }
View Full Code Here

    {
      res.addError("GLOBAL_loginError", "$youNeedToProvideALoginName");
      return res.createCommand(Constants.PROMPT_LOGIN).execute(req, res);
    }

    PermissionManager permissionManager = (PermissionManager) SpringTools.getBean(PermissionManager.ID);
    if (! permissionManager.hasPermission(loginName, "de.iritgo.aktera.web.login"))
    {
      res.addError("GLOBAL_loginError", "$youAreNotAllowedToLogin");
      return res.createCommand(Constants.PROMPT_LOGIN).execute(req, res);
    }
View Full Code Here

TOP

Related Classes of de.iritgo.aktera.permissions.PermissionManager

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.