/** * Returns the String representation of the action list. * * @return Action list of this permission instance. It is always * "privatearea". * @see java.security.Permission#getActions() */ public String getActions() { return delegate.getActions(); }
/** * Returns the String representation of the action list. * <p> * The method always gives back the actions in the following (alphabetical) * order: * {@code cancel, install, list, metadata, uninstall, uninstall_forced} * * @return Action list of this permission instance. This is a * comma-separated list that reflects the action parameter of the * constructor. * @see java.security.Permission#getActions() */ public String getActions() { return delegate.getActions(); }
private Set<String> filterRoles(HttpServletRequest request, PermissionCollection permissionCollection) { Set<String> roles = new HashSet<>(); for (Permission permission : list(permissionCollection.elements())) { if (permission instanceof WebRoleRefPermission) { String role = permission.getActions(); // Note that the WebRoleRefPermission is given for every Servlet in the application, even when // no role refs are used anywhere. This will also include Servlets like the default servlet and the // implicit JSP servlet. So if there are 2 application roles, and 3 application servlets, then // at least 6 WebRoleRefPermission elements will be present in the collection. if (!roles.contains(role) && request.isUserInRole(role)) { roles.add(role); } } } return roles; }
private void handlePermissionCheckEvent(SecurityPermissionCheckEvent event, StringBuilder stringBuilder) { handleDefiniteOutcomeEvent(event, stringBuilder); Permission permission = event.getPermission(); stringBuilder.append(",permission=[type=").append(permission.getClass().getName()); stringBuilder.append(",actions=").append(permission.getActions()); stringBuilder.append(",name=").append(permission.getName()).append(']'); }
private void handlePermissionCheckEvent(SecurityPermissionCheckEvent event, JsonObjectBuilder objectBuilder) { handleDefiniteOutcomeEvent(event, objectBuilder); Permission permission = event.getPermission(); JsonObjectBuilder permissionBuilder = Json.createObjectBuilder(); permissionBuilder.add("type", permission.getClass().getName()); permissionBuilder.add("actions", permission.getActions()); permissionBuilder.add("name", permission.getName()); objectBuilder.add("permission", permissionBuilder); }
/** * Learn whether the permission matches in case of a revoked permission. * @param perm The permission to check against. */ boolean matches(final java.security.Permission perm) { if (!className.equals(perm.getClass().getName())) { //NOSONAR return false; } if (name != null) { if (name.endsWith("*")) { if (!perm.getName().startsWith(name.substring(0, name.length() - 1))) { return false; } } else if (!name.equals(perm.getName())) { return false; } } if (actions != null) { final Set<String> as = parseActions(perm.getActions()); final int size = as.size(); as.removeAll(actions); // If no actions removed, then all allowed return as.size() != size; } return true; }
/** * Returns the String representation of the action list.<p> * The method always gives back the actions in the following (alphabetical) order: * <code>cancel, install, list, metadata, uninstall, uninstall_forced</code> * * @return Action list of this permission instance. This is a comma-separated * list that reflects the action parameter of the constructor. * @see java.security.Permission#getActions() */ public String getActions() { return delegate.getActions(); }
/** * Returns the String representation of the action list. * * @return Action list of this permission instance. It is always "privatearea". * @see java.security.Permission#getActions() */ public String getActions() { return delegate.getActions(); }
@Override public String getActions() { return badDefaultPermission.getActions(); }
actions = ((UnresolvedPermission) permission).getUnresolvedActions(); } else { actions = permission.getActions();
if (log != null) { Permission perm = ace.getPermission(); if (perm instanceof FilePermission && perm.getActions().equals("read")) { log.warning("Reading " + perm.getName() + " is not permitted. See \"per context logging\" in the default catalina.policy file.");
/** * Returns the String representation of the action list. * * @return Action list of this permission instance. It is always * "privatearea". * @see java.security.Permission#getActions() */ @Override public String getActions() { return delegate.getActions(); }
/** * Returns the String representation of the action list.<p> * The method always gives back the actions in the following (alphabetical) order: * {@code cancel, install, list, metadata, uninstall, uninstall_forced} * * @return Action list of this permission instance. This is a comma-separated * list that reflects the action parameter of the constructor. * @see java.security.Permission#getActions() */ public String getActions() { return delegate.getActions(); }
/** * Returns the String representation of the action list. * * @return Action list of this permission instance. It is always "privatearea". * @see java.security.Permission#getActions() */ public String getActions() { return delegate.getActions(); }
permissionElement.appendChild(nameElement); final String actions = permission.getActions(); if (actions != null && ! actions.isEmpty()) { final Element actionsElement = new Element("actions");
private String getPermissionType(Permission permission) { String name = permission.getName(); String actions = permission.getActions(); String type = ""; if (actions != null && !actions.isEmpty()) { type += actions + " "; } if (name != null && !name.isEmpty()) { type += name; } return type; }
private void doPermDump(PermissionCollection pc, String string) { Enumeration<Permission> en = pc.elements(); while (en.hasMoreElements()) { Permission p = en.nextElement(); logger.info(string + "===>P:" + p.getClass() + " N:" + p.getName() + " A:" + p.getActions()); } }
/** * @param permission the {@link Permission} to check against * @return true if the actions match, or this permission implies any set of * actions (e.g. *) */ private boolean hasMatchingActions(Permission permission) { return getActions().equals("*") || actionList.containsAll(parseActions(permission.getActions())); }
public boolean implies(Permission permission) { //TODO! return ( "*".equals( getName() ) || getName().equals( permission.getName() ) ) && ( "*".equals(actions) || actions.indexOf( permission.getActions() ) >= 0 ); }
private void handlePermissionCheckEvent(SecurityPermissionCheckEvent event, JsonObjectBuilder objectBuilder) { handleDefiniteOutcomeEvent(event, objectBuilder); Permission permission = event.getPermission(); JsonObjectBuilder permissionBuilder = Json.createObjectBuilder(); permissionBuilder.add("type", permission.getClass().getName()); permissionBuilder.add("actions", permission.getActions()); permissionBuilder.add("name", permission.getName()); objectBuilder.add("permission", permissionBuilder); }