Examples of PermissionInfo


Examples of com.github.theholywaffle.teamspeak3.api.wrapper.PermissionInfo

  public List<PermissionInfo> getPermissions() {
    CPermissionList list = new CPermissionList();
    if (query.doCommand(list)) {
      List<PermissionInfo> permissions = new ArrayList<>();
      for (HashMap<String, String> opt : list.getResponse()) {
        permissions.add(new PermissionInfo(opt));
      }
      return permissions;
    }
    return null;
  }
View Full Code Here

Examples of com.platymuus.bukkit.permissions.PermissionInfo

    }

    @Override
    public String[] getPlayerGroups(String world, String player) {
        List<String> groupList = new ArrayList<String>();
        PermissionInfo info = perms.getPlayerInfo(player);
        if (world != null && info != null) {
            for (Group group : perms.getPlayerInfo(player).getGroups()) {
                if (group.getInfo().getWorlds().contains(world)) {
                    groupList.add(group.getName());
                }
            }
            return groupList.toArray(new String[0]);
        }
        if (info != null) {
            for (Group group : info.getGroups()) {
                groupList.add(group.getName());
            }
        }
        return groupList.toArray(new String[0]);
    }
View Full Code Here

Examples of org.osgi.service.permissionadmin.PermissionInfo

  /**
   *
   */
  public PermissionInfoStorage(FrameworkContext ctx) {
    debug = ctx.debug;
    initialDefault = new PermissionInfo[] { new PermissionInfo(DEFAULTPERM) };
    defaultPermissions = initialDefault;

    permDir = Util.getFileStorage(ctx, "perms");
    if (permDir == null) {
      System.err.println("Property org.osgi.framework.dir not set," +
View Full Code Here

Examples of org.osgi.service.permissionadmin.PermissionInfo

          return;
        } else if ("".equals(line)) {
          // Correct end with double NL
          break;
        }
        piv.add(new PermissionInfo(line));
        c = in.read();
      }
      if (c == -1) {
        throw new IOException("Premature EOF when parsing permission file: " + fh.getName());
      }
View Full Code Here

Examples of org.osgi.service.permissionadmin.PermissionInfo

        } while(c != ec);
        String info = new String(eca, start_pos, pos - start_pos);
        if (c == ']') {
          cal.add(new ConditionInfo(info));
        } else {
          pal.add(new PermissionInfo(info));
        }
      }
      if (!seenPermInfo) {
        throw new IllegalArgumentException("Permissions must contain atleast one element");
      }
View Full Code Here

Examples of org.osgi.service.permissionadmin.PermissionInfo

      pi = permissionAdmin.getDefaultPermissions();
    } else {
      loc = (String) opts.get("-l");
      pi = permissionAdmin.getPermissions(loc);
    }
    PermissionInfo pia;
    try {
      pia = new PermissionInfo((String)opts.get("type"),
                               (String)opts.get("name"),
                               (String)opts.get("actions"));
    } catch (IllegalArgumentException e) {
      out.println("ERROR! " + e.getMessage());
      out.println("PermissionInfo type = " + opts.get("type"));
View Full Code Here

Examples of org.osgi.service.permissionadmin.PermissionInfo

        if (cpi.endsWith(endChar)) {
          try {
            if (endChar == "]") {
              cis.addElement(new ConditionInfo(buf.toString()));
            } else {
              pis.addElement(new PermissionInfo(buf.toString()));
            }
          } catch (IllegalArgumentException e) {
            out.println("ERROR! Failed to instanciate: " + buf.toString()
                + " " + e.getMessage());
            return 1;
View Full Code Here

Examples of org.osgi.service.permissionadmin.PermissionInfo

                char c = encoded[pos++];
                if (c != ')') {
                        throw new IllegalArgumentException(
                                        "expecting close parenthesis");
                }
                permissions.add(new PermissionInfo(parsedType,parsedName, parsedActions));
                return pos;
        }
        catch (ArrayIndexOutOfBoundsException e) {
                throw new IllegalArgumentException("parsing terminated abruptly");
        }
View Full Code Here

Examples of org.osgi.service.permissionadmin.PermissionInfo

    public PermissionInfo[] getImplicit(Bundle bundle)
    {
        return new PermissionInfo[] {
            IMPLICIT[0],
            new PermissionInfo(AdminPermission.class.getName(), "(id="
                + bundle.getBundleId() + ")", AdminPermission.METADATA),
            new PermissionInfo(AdminPermission.class.getName(), "(id="
                + bundle.getBundleId() + ")", AdminPermission.RESOURCE),
            new PermissionInfo(AdminPermission.class.getName(), "(id="
                + bundle.getBundleId() + ")", AdminPermission.CONTEXT) };
    }
View Full Code Here

Examples of org.osgi.service.permissionadmin.PermissionInfo

                            {
                                name += postfix;
                            }
                        }
                    }
                    Permission source = createPermission(new PermissionInfo(
                        FilePermission.class.getName(), name,
                        m_permissionInfos[i].getActions()), targetClass);
                    if (source.implies(target))
                    {
                        return true;
                    }
                }
            }
            return false;
        }

        Object current = m_stack.get();

        if (current == null)
        {
            m_stack.set(targetClass);
        }
        else
        {
            if (current instanceof HashSet)
            {
                if (((HashSet) current).contains(targetClass))
                {
                    return false;
                }
                ((HashSet) current).add(targetClass);
            }
            else
            {
                if (current == targetClass)
                {
                    return false;
                }
                HashSet frame = new HashSet();
                frame.add(current);
                frame.add(targetClass);
                m_stack.set(frame);
                current = frame;
            }
        }

        try
        {
            SoftReference collectionEntry = null;

            PermissionCollection collection = null;

            synchronized (m_cache)
            {
                collectionEntry = (SoftReference) m_cache.get(targetClass);
            }

            if (collectionEntry != null)
            {
                collection = (PermissionCollection) collectionEntry.get();
            }

            if (collection == null)
            {
                collection = target.newPermissionCollection();

                if (collection == null)
                {
                    collection = new DefaultPermissionCollection();
                }

                for (int i = 0; i < m_permissionInfos.length; i++)
                {
                    PermissionInfo permissionInfo = m_permissionInfos[i];
                    String infoType = permissionInfo.getType();
                    String permissionType = targetClass.getName();

                    if (infoType.equals(permissionType))
                    {
                        Permission permission = createPermission(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.