/*
(non-Javadoc)

@see com.ibm.ws.javaee.dd.permissions.PermissionsConfig#getPermissions()
177385
@SuppressWarnings("unchecked")
    @Override
    public List getPermissions() {
        // TODO Auto-generated method stub
        if (this.permissions != null) {
            return this.permissions.getList();
        } else
            return Collections.emptyList();
    }
208261
public List<SecurityPermissionType<ResourceadapterType<T>>> getAllSecurityPermission()
   {
      List<SecurityPermissionType<ResourceadapterType<T>>> list = new ArrayList<SecurityPermissionType<ResourceadapterType<T>>>();
      List<Node> nodeList = childNode.get("security-permission");
      for(Node node: nodeList)
      {
         SecurityPermissionType<ResourceadapterType<T>>  type = new SecurityPermissionTypeImpl<ResourceadapterType<T>>(this, "security-permission", childNode, node);
         list.add(type);
      }
      return list;
   }
1285471
public ResponseBuilder withAskForPermissionsConsentCard(List<String> permissions) {
        this.card = AskForPermissionsConsentCard.builder()
                .withPermissions(permissions)
                .build();
        return this;
    }
523445
public function getPermissions() {
		$permissions = [];
		foreach ($this->role->sharedPermissionList as $permission) {
			$permissions[] = $permission->name;
		}

		return $permissions;
	}
1174637
@Override
    public Collection<Permission> getAllPermissionsFromPermissionSet(String permissionSet)
        throws PermissionSetNotFoundException {
        Collection<Permission> result = new HashSet<Permission>();
        for (String s : getAllPermissionSetsFromPermissionSet(permissionSet)) {
            result.addAll(getPermissionsFromPermissionSet(s));
        }
        return result;
    }
1106363
public Collection<Permission> getAggregatePermissions() {
        if (aggregatePermissions == null) {
            Set<Permission> perms = new LinkedHashSet<>();
            perms.addAll(permissions);
            for (Role role : roles) {
                perms.addAll(role.getPermissions());
            }

            if (perms.isEmpty()) {
                aggregatePermissions = Collections.emptySet();
            } else {
                aggregatePermissions = Collections.unmodifiableSet(perms);
            }
        }

        return aggregatePermissions;
    }
1215485
public CmsPermissionSetCustom getPermissions(CmsUser user, List<CmsGroup> groups, List<CmsRole> roles) {

        CmsPermissionSetCustom sum = new CmsPermissionSetCustom();
        boolean hasPermissions = false;
        CmsPermissionSet p = m_permissions.get(user.getId());
        if (p != null) {
            sum.addPermissions(p);
            hasPermissions = true;
        }
        if (groups != null) {
            int size = groups.size();
            for (int i = 0; i < size; i++) {
                I_CmsPrincipal principal = groups.get(i);
                p = m_permissions.get(principal.getId());
                if (p != null) {
                    sum.addPermissions(p);
                    hasPermissions = true;
                }
            }
        }
        if (roles != null) {
            int size = roles.size();
            for (int i = 0; i < size; i++) {
                CmsRole role = roles.get(i);
                p = m_permissions.get(role.getId());
                if (p != null) {
                    sum.addPermissions(p);
                    hasPermissions = true;
                }
            }
        }
        if (!hasPermissions) {
            // if no applicable entry is found check the 'all others' entry
            p = m_permissions.get(CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_ID);
            if (p != null) {
                sum.addPermissions(p);
            }
        }
        return sum;
    }
236365
public Permission<Permissions<T>> getOrCreatePermission()
   {
      List<Node> nodeList = childNode.get("permission");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new PermissionImpl<Permissions<T>>(this, "permission", childNode, nodeList.get(0));
      }
      return createPermission();
   }
875041
public static boolean hasPermission(Permission permission) {
        SecurityManager security = System.getSecurityManager();
        if (security != null) {
            try {
                security.checkPermission(permission);
            } catch (java.security.AccessControlException e) {
                return false;
            }
        }
        return true;
    }
1220338
public void setPermissions(String newPermissions) {
		int cp = 0;

		if (permissions != null) {
			cp = cp
					| (((permissions.longValue() & S_IFMT) == S_IFMT) ? S_IFMT
							: 0);
			cp = cp
					| (((permissions.longValue() & S_IFSOCK) == S_IFSOCK) ? S_IFSOCK
							: 0);
			cp = cp
					| (((permissions.longValue() & S_IFLNK) == S_IFLNK) ? S_IFLNK
							: 0);
			cp = cp
					| (((permissions.longValue() & S_IFREG) == S_IFREG) ? S_IFREG
							: 0);
			cp = cp
					| (((permissions.longValue() & S_IFBLK) == S_IFBLK) ? S_IFBLK
							: 0);
			cp = cp
					| (((permissions.longValue() & S_IFDIR) == S_IFDIR) ? S_IFDIR
							: 0);
			cp = cp
					| (((permissions.longValue() & S_IFCHR) == S_IFCHR) ? S_IFCHR
							: 0);
			cp = cp
					| (((permissions.longValue() & S_IFIFO) == S_IFIFO) ? S_IFIFO
							: 0);
			cp = cp
					| (((permissions.longValue() & S_ISUID) == S_ISUID) ? S_ISUID
							: 0);
			cp = cp
					| (((permissions.longValue() & S_ISGID) == S_ISGID) ? S_ISGID
							: 0);
		}

		int len = newPermissions.length();

		if (len >= 1) {
			cp = cp
					| ((newPermissions.charAt(0) == 'r') ? SftpFileAttributes.S_IRUSR
							: 0);
		}

		if (len >= 2) {
			cp = cp
					| ((newPermissions.charAt(1) == 'w') ? SftpFileAttributes.S_IWUSR
							: 0);
		}

		if (len >= 3) {
			cp = cp
					| ((newPermissions.charAt(2) == 'x') ? SftpFileAttributes.S_IXUSR
							: 0);
		}

		if (len >= 4) {
			cp = cp
					| ((newPermissions.charAt(3) == 'r') ? SftpFileAttributes.S_IRGRP
							: 0);
		}

		if (len >= 5) {
			cp = cp
					| ((newPermissions.charAt(4) == 'w') ? SftpFileAttributes.S_IWGRP
							: 0);
		}

		if (len >= 6) {
			cp = cp
					| ((newPermissions.charAt(5) == 'x') ? SftpFileAttributes.S_IXGRP
							: 0);
		}

		if (len >= 7) {
			cp = cp
					| ((newPermissions.charAt(6) == 'r') ? SftpFileAttributes.S_IROTH
							: 0);
		}

		if (len >= 8) {
			cp = cp
					| ((newPermissions.charAt(7) == 'w') ? SftpFileAttributes.S_IWOTH
							: 0);
		}

		if (len >= 9) {
			cp = cp
					| ((newPermissions.charAt(8) == 'x') ? SftpFileAttributes.S_IXOTH
							: 0);
		}

		setPermissions(new UnsignedInteger32(cp));
	}
1056809
public function getPermissions()
    {
        $permissions = &gplcart_static('user.role.permissions');

        if (isset($permissions)) {
            return $permissions;
        }

        $permissions = (array) gplcart_config_get(GC_FILE_CONFIG_PERMISSION);
        asort($permissions);

        $this->hook->attach('user.role.permissions', $permissions, $this);
        return $permissions;
    }
637770
private IAuthorizationPrincipal[] getPrincipalsFromPermissions(IPermission[] permissions)
            throws AuthorizationException {
        Set principals = new HashSet();
        for (int i = 0; i < permissions.length; i++) {
            IAuthorizationPrincipal principal = getPrincipal(permissions[i]);
            principals.add(principal);
        }
        return ((IAuthorizationPrincipal[])
                principals.toArray(new IAuthorizationPrincipal[principals.size()]));
    }
1242591
public function getUserPermissions()
    {
        $permissions = $this->getPermissions();

        if (!$this->isOwner()) {
            foreach (self::$ownerPermissions as $permission) {
                $key = array_search($permission, $permissions, true);
                if (false !== $key) {
                    unset($permissions[$key]);
                }
            }
        }

        return $permissions;
    }
574381
public java.util.List<IpPermission> getIpPermissionsEgress() {
        if (ipPermissionsEgress == null) {
            ipPermissionsEgress = new com.amazonaws.internal.SdkInternalList<IpPermission>();
        }
        return ipPermissionsEgress;
    }
339565
private void ajaxGetPermissions(final Project project, final HashMap<String, Object> ret) {
    final ArrayList<HashMap<String, Object>> permissions =
        new ArrayList<>();
    for (final Pair<String, Permission> perm : project.getUserPermissions()) {
      final HashMap<String, Object> permObj = new HashMap<>();
      final String userId = perm.getFirst();
      permObj.put("username", userId);
      permObj.put("permission", perm.getSecond().toStringArray());

      permissions.add(permObj);
    }

    ret.put("permissions", permissions);
  }
163331
public static String[] jcrPermissions( String cmisPermission ) {
        switch (cmisPermission) {
            case "cmis:read" :
                return new String[] {
                    Privilege.JCR_READ,
                    Privilege.JCR_READ_ACCESS_CONTROL
                };
            case "cmis:write" : 
                return new String[] {
                    Privilege.JCR_WRITE,
                    Privilege.JCR_READ_ACCESS_CONTROL,
                    Privilege.JCR_MODIFY_ACCESS_CONTROL,
                    Privilege.JCR_NODE_TYPE_MANAGEMENT,
                    Privilege.JCR_RETENTION_MANAGEMENT,
                    Privilege.JCR_VERSION_MANAGEMENT
                };
            case "cmis:all" :
                return new String[] {Privilege.JCR_ALL};
            default :
                    return null;
        }
    }
548817
public List<ISubmission> getSubmissions() throws Exception{
		
		List<ISubmission> submissions = new ArrayList<ISubmission>();
		
		LRImporter importer = new LRImporter(node.getHost(), node.getScheme());
		
		submissions = getMoreSubmissions(importer, submissions, null);
		
		return submissions;
	}