Examples of PermissionManager


Examples of org.drools.repository.security.PermissionManager

    @LoggedIn
    public Map<String, List<String>> retrieveUserPermissions(String userName) {
        serviceSecurity.checkSecurityIsAdmin();

        PermissionManager pm = new PermissionManager( rulesRepository );
        return pm.retrieveUserPermissions( userName );
    }
View Full Code Here

Examples of org.drools.repository.security.PermissionManager

    @LoggedIn
    public void updateUserPermissions(String userName,
                                      Map<String, List<String>> perms) {
        serviceSecurity.checkSecurityIsAdmin();

        PermissionManager pm = new PermissionManager( rulesRepository );

        log.info( "Updating user permissions for userName [" + userName + "] to [" + perms + "]" );
        pm.updateUserPermissions( userName,
                                  perms );
        rulesRepository.save();
    }
View Full Code Here

Examples of org.drools.repository.security.PermissionManager

    }

    @LoggedIn
    public void deleteUser(String userName) {
        log.info( "Removing user permissions for user name [" + userName + "]" );
        PermissionManager pm = new PermissionManager( rulesRepository );
        pm.removeUserPermissions( userName );
        rulesRepository.save();
    }
View Full Code Here

Examples of org.osgi.impl.bundle.jmx.permissionadmin.PermissionManager

      log.fine("Registering permission admin with MBeanServer: "
          + mbeanServer + " with name: " + name);
      PermissionAdmin admin = (PermissionAdmin) bundleContext
          .getService(reference);
      try {
        manager = new StandardMBean(new PermissionManager(admin),
            PermissionManagerMBean.class);
      } catch (NotCompliantMBeanException e1) {
        log.log(Level.SEVERE,
            "Unable to create Permission Admin Manager");
        return admin;
View Full Code Here

Examples of org.ow2.easybeans.security.permissions.PermissionManager

                // Bind references only once
                bindReferences();

                // Permission Manager.
                try {
                    this.permissionManager = new PermissionManager(getArchive().getURL(), this.ejbJarInfo);
                    // translate metadata into permission
                    this.permissionManager.translateMetadata();
                    // commit
                    this.permissionManager.commit();
                } catch (PermissionManagerException e) {
View Full Code Here

Examples of org.wso2.carbon.osgi.security.PermissionManager

     *
     * @param context the framework context for the bundle.
     */
    public void start(BundleContext context) throws Exception {
        try {
            context.addBundleListener(new PermissionManager(context));
        } catch (Throwable e) {
            e.printStackTrace(); // We haven't imported commons.logging
        }
    }
View Full Code Here

Examples of ru.tehkode.permissions.PermissionManager

public class PermissionsExResolver extends DinnerPermsResolver {
    private final PermissionManager manager;

    public static PermissionsResolver factory(Server server, YAMLProcessor config) {
        try {
            PermissionManager manager = server.getServicesManager().load(PermissionManager.class);

            if (manager == null) {
                return null;
            }
View Full Code Here

Examples of ru.tehkode.permissions.PermissionManager

    public void setParams(Map<String, String> params) {
      this.params = params;
    }

    public boolean checkPermissions(Player player) {
      PermissionManager manager = PermissionsEx.getPermissionManager();

      String permission = this.getMethodAnnotation().permission();


      if (permission.contains("<")) {
        for (Entry<String, String> entry : this.getParams().entrySet()) {
          if (entry.getValue() != null) {
            permission = permission.replace("<" + entry.getKey() + ">", entry.getValue().toLowerCase());
          }
        }
      }

      return manager.has(player, permission);

    }
View Full Code Here

Examples of ru.tehkode.permissions.PermissionManager

      syntax = "world <world> inherit <parentWorlds>",
      description = "Set <parentWorlds> for <world>",
      permission = "permissions.manage.worlds.inheritance")
  public void worldSetInheritance(PermissionsEx plugin, CommandSender sender, Map<String, String> args) {
    String worldName = this.autoCompleteWorldName(args.get("world"));
    PermissionManager manager = plugin.getPermissionsManager();
    if (plugin.getServer().getWorld(worldName) == null) {
      sender.sendMessage("Specified world \"" + args.get("world") + "\" not found.");
      return;
    }

    List<String> parents = new ArrayList<>();
    String parentWorlds = args.get("parentWorlds");
    if (parentWorlds.contains(",")) {
      for (String world : parentWorlds.split(",")) {
        world = this.autoCompleteWorldName(world, "parentWorlds");
        if (!parents.contains(world)) {
          parents.add(world.trim());
        }
      }
    } else {
      parents.add(parentWorlds.trim());
    }

    manager.setWorldInheritance(worldName, parents);

    sender.sendMessage("World \"" + worldName + "\" inherits " + StringUtils.implode(parents, ", "));
  }
View Full Code Here

Examples of ru.tehkode.permissions.PermissionManager

      syntax = "import <backend>",
      permission = "permissions.dump",
      description = "Import data from <backend> as specified in the configuration")
  public void dumpData(PermissionsEx plugin, CommandSender sender, Map<String, String> args) {
    try {
      PermissionManager mgr = plugin.getPermissionsManager();
      PermissionBackend backend = mgr.createBackend(args.get("backend"));
      mgr.getBackend().loadFrom(backend);

      sender.sendMessage(ChatColor.WHITE + "[PermissionsEx] Data from \"" + args.get("backend") + "\" loaded into currently active backend");
    } catch (RuntimeException e) {
      if (e.getCause() instanceof ClassNotFoundException) {
        sender.sendMessage(ChatColor.RED + "Specified backend not found!");
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.