Examples of Permission


Examples of org.osforce.connect.entity.system.Permission

  public String doFormAction(@RequestParam Long siteId, @RequestParam Long categoryId,
      @RequestParam Long[] resourceIds, @RequestParam Long[] roleIds) {
    for(int i=0; i<resourceIds.length; i++) {
      Long resourceId = resourceIds[i];
      Long roleId = roleIds[i];
      Permission permission = permissionService.getPermission(resourceId, categoryId);
      if(permission==null) {
        permission = new Permission(resourceId, categoryId);
      }
      permission.setRoleId(roleId);
      permissionService.updatePermission(permission);
    }
    return String.format("redirect:/system/permission/list?siteId=%s", siteId);
  }
View Full Code Here

Examples of org.osforce.connect.web.security.annotation.Permission

    WidgetConfig widgetConfig = (WidgetConfig) request.getAttribute(WidgetConfig.KEY) ;
    if(widgetConfig!=null) {
      Project project = (Project) request.getAttribute(PROJECT_KEY);
      User user = (User) request.getAttribute(USER_KEY);
      String requestPath = widgetConfig.getPath();
      Permission permission = permissionMappings.get(requestPath);
      if(permission!=null) {
        // validate user
        if(permission.userRequired() && user==null) {
          return false;
        }
        // validate project
        if(permission.projectRequired() && project==null) {
          return false;
        }
        // validate resource
        String[] resources = permission.value();
        return permissionService.hasPermission(project, user, resources);
      }
    }
    return true;
  }
View Full Code Here

Examples of org.pathways.openciss.model.Permission

public class PermissionService {
  public static EntityManager em;
 
  public Permission getPermission(int permission_key) {
    Permission result = null;
    em =EMF.get().createEntityManager();
    try {
      result = em.find(Permission.class, permission_key);
    }
    finally {em.close();}
View Full Code Here

Examples of org.rhq.core.domain.authz.Permission

        // Update the value of the authorized fields in each row of the grids.

        ListGridRecord[] globalPermissionRecords = this.globalPermissionsGrid.getRecords();
        for (ListGridRecord record : globalPermissionRecords) {
            String permissionName = record.getAttribute("name");
            Permission permission = Permission.valueOf(permissionName);
            record.setAttribute("authorized", this.selectedPermissions.contains(permission));
        }

        ListGridRecord[] resourcePermissionRecords = this.resourcePermissionsGrid.getRecords();
        for (ListGridRecord record : resourcePermissionRecords) {
            String readPermissionName = record.getAttribute("readName");
            Permission readPermission = Permission.valueOf(readPermissionName);
            record.setAttribute("readAuthorized", this.selectedPermissions.contains(readPermission));

            String writePermissionName = record.getAttribute("writeName");
            Permission writePermission = Permission.valueOf(writePermissionName);
            record.setAttribute("writeAuthorized", this.selectedPermissions.contains(writePermission));
        }

        ListGridRecord[] bundleGroupPermissionRecords = this.bundleGroupPermissionsGrid.getRecords();
        for (ListGridRecord record : bundleGroupPermissionRecords) {
            String permissionName = record.getAttribute("name");
            Permission permission = Permission.valueOf(permissionName);
            record.setAttribute("authorized", this.selectedPermissions.contains(permission));
        }

        markForRedraw();
    }
View Full Code Here

Examples of org.springframework.integration.aws.Permission

      NodeList permNodes = permissionsElement.getChildNodes();
      for (int i = 0; i < permNodes.getLength(); i++) {
        Node permNode = permNodes.item(i);
        if (Node.ELEMENT_NODE == permNode.getNodeType()) {
          Element permissionElement = (Element) permNode;
          Permission permission = new Permission(
              permissionElement.getAttribute("label"),
              new HashSet<String>(), new HashSet<String>());

          Element actionsElement = DomUtils.getChildElementByTagName(
              permissionElement, "actions");
          NodeList actionNodes = actionsElement.getChildNodes();
          for (int j = 0; j < actionNodes.getLength(); j++) {
            Node actionNode = actionNodes.item(j);
            if (Node.ELEMENT_NODE == actionNode.getNodeType()) {
              Element actionElement = (Element) actionNode;
              permission.getActions().add(
                  actionElement.getTextContent());
            }
          }

          Element accountsElement = DomUtils
              .getChildElementByTagName(permissionElement,
                  "aws-accounts");
          NodeList accountNodes = accountsElement.getChildNodes();
          for (int j = 0; j < accountNodes.getLength(); j++) {
            Node accountNode = accountNodes.item(j);
            if (Node.ELEMENT_NODE == accountNode.getNodeType()) {
              Element accountElement = (Element) accountNode;
              permission.getAwsAccountIds().add(
                  accountElement.getTextContent());
            }
          }

          permissions.add(permission);
View Full Code Here

Examples of org.springframework.security.acls.model.Permission

            return Arrays.asList((Permission[])permission);
        }

        if (permission instanceof String) {
            String permString = (String)permission;
            Permission p;

            try {
                p = permissionFactory.buildFromName(permString);
            } catch(IllegalArgumentException notfound) {
                p = permissionFactory.buildFromName(permString.toUpperCase());
View Full Code Here

Examples of org.wicketstuff.security.hive.authorization.Permission

    }
    // permission has no exact match, perform an implies check
    Iterator<Permission> it = principals.leftIterator();
    while (it.hasNext())
    {
      Permission possibleMatch = it.next();
      if (!possibleMatch.implies(permission))
        continue;
      if (hasPrincipal(subject, principals.getRight(possibleMatch)))
      {
        if (log.isDebugEnabled())
          log.debug(subject + " implies " + permission);
View Full Code Here

Examples of org.wso2.carbon.user.core.Permission

                                        "The domain you are trying to login already exist. If you can prove your rights to this domain please contact administrator.");
                }
                String password = UUIDGenerator.getUUID();
                UserStoreManager userStore = userRealm.getUserStoreManager();
                if (!userStore.isExistingRole(IdentityConstants.IDENTITY_DEFAULT_ROLE)) {
                    Permission permission =
                                            new Permission("/permission/admin/login",
                                                           UserMgtConstants.EXECUTE_ACTION);
                    userStore.addRole(IdentityConstants.IDENTITY_DEFAULT_ROLE, null,
                                      new Permission[] { permission });
                }
                userStore.addUser(username, password, new String[]{IdentityConstants.IDENTITY_DEFAULT_ROLE}, null, null);
View Full Code Here

Examples of simpleserver.config.xml.Permission

  }

  private Area createPlayerArea(Player player) {
    Area area = new Area(t("%s's area", player.getName()), player.areastart, player.areaend);
    area.owner = player.getName().toLowerCase();
    Permission perm = new Permission(player);
    AllBlocks blocks = new AllBlocks();
    blocks.destroy = perm;
    blocks.place = perm;
    blocks.use = perm;
    area.allblocks.blocks = blocks;
View Full Code Here

Examples of uk.co.oliwali.HawkEye.util.Permission

    Util.info("Starting HawkEye " + version + " initiation process...");

    //Load config and permissions
        config = new Config(this);
        new Permission(this);

        versionCheck();

        new SessionManager();
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.