Tabnine Logo
SimpleManagementPermission
Code IndexAdd Tabnine to your IDE (free)

How to use
SimpleManagementPermission
in
org.jboss.as.controller.access.permission

Best Java code snippets using org.jboss.as.controller.access.permission.SimpleManagementPermission (Showing top 20 results out of 315)

origin: org.wildfly/wildfly-controller

  public ManagementPermission createScopedPermission(Constraint constraint, int constraintIndex) {
    Constraint[] altered;
    if (constraintIndex == constraints.length) {
      altered = new Constraint[constraintIndex + 1];
      System.arraycopy(constraints, 0, altered, 0, constraints.length);
    } else {
      Constraint existing = constraints[constraintIndex];
      if (constraint.replaces(existing)) {
        altered = new Constraint[constraints.length];
        System.arraycopy(constraints, 0, altered, 0, constraints.length);
      } else {
        altered = new Constraint[constraintIndex + 1];
        if (constraintIndex == 0) {
          System.arraycopy(constraints, 0, altered, 1, constraints.length);
        } else {
          System.arraycopy(constraints, 0, altered, 0, constraintIndex);
          System.arraycopy(constraints, constraintIndex, altered, constraintIndex + 1, constraints.length - constraintIndex);
        }
      }
    }
    altered[constraintIndex] = constraint;
    return new SimpleManagementPermission(getActionEffect(), altered);
  }
}
origin: org.wildfly.core/wildfly-controller

@Override
public boolean implies(Permission permission) {
  if (equals(permission)) {
    SimpleManagementPermission other = (SimpleManagementPermission) permission;
    // Validate constraints
    assert constraints.length == other.constraints.length : String.format("incompatible ManagementPermission; " +
        "differing constraint counts %d vs %d", constraints.length, other.constraints.length);
    Action.ActionEffect actionEffect = getActionEffect();
    for (int i = 0; i < constraints.length; i++) {
      Constraint ours = constraints[i];
      Constraint theirs = other.constraints[i];
      assert ours.getClass() == theirs.getClass() : "incompatible constraints: ours = " + ours.getClass() + " -- theirs = " + theirs.getClass();
      if (ours.violates(theirs, actionEffect)) {
        ControllerLogger.ACCESS_LOGGER.tracef("Constraints are violated for %s", actionEffect);
        return false;
      }
    }
    return true;
  }
  return false;
}
origin: wildfly/wildfly-core

while (monitorEnumeration.hasMoreElements()) {
  SimpleManagementPermission monitorPerm = (SimpleManagementPermission) monitorEnumeration.nextElement();
  monitorPermissions.put(monitorPerm.getActionEffect(), monitorPerm);
while (permissionEnumeration.hasMoreElements()) {
  SimpleManagementPermission basePerm = (SimpleManagementPermission) permissionEnumeration.nextElement();
  Action.ActionEffect actionEffect = basePerm.getActionEffect();
  CombinationManagementPermission combinedPermission = new CombinationManagementPermission(CombinationPolicy.PERMISSIVE, actionEffect);
  if (scopedPermissions == null) {
    scopedPermissions = new ManagementPermissionCollection(officialForm, CombinationManagementPermission.class);
  ManagementPermission scopedPerm = basePerm.createScopedPermission(scopingConstraint.getStandardConstraint(), constraintIndex);
  combinedPermission.addUnderlyingPermission(scopedBaseName, scopedPerm);
  if (monitorPerm != null) {
    combinedPermission.addUnderlyingPermission(scopedReadOnlyName,
        monitorPerm.createScopedPermission(scopingConstraint.getOutofScopeReadConstraint(), constraintIndex));
origin: org.wildfly.core/wildfly-controller

private synchronized Map<String, ManagementPermissionCollection> configureDefaultPermissions() {
  Map<String, ManagementPermissionCollection> result = new HashMap<String, ManagementPermissionCollection>();
  for (StandardRole standardRole : StandardRole.values()) {
    String officialForm = getOfficialForm(standardRole);
    ManagementPermissionCollection rolePerms = new ManagementPermissionCollection(officialForm, SimpleManagementPermission.class);
    for (Action.ActionEffect actionEffect : Action.ActionEffect.values()) {
      if (standardRole.isActionEffectAllowed(actionEffect)) {
        Constraint[] constraints = new Constraint[constraintFactories.size()];
        int i = 0;
        for (ConstraintFactory factory : this.constraintFactories) {
          constraints[i] = factory.getStandardUserConstraint(standardRole, actionEffect);
          i++;
        }
        rolePerms.add(new SimpleManagementPermission(actionEffect, constraints));
      }
    }
    result.put(officialForm, rolePerms);
  }
  return result;
}
origin: org.wildfly.core/wildfly-controller

@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;
  ManagementPermission that = (ManagementPermission) o;
  return getActionEffect() == that.getActionEffect();
}
origin: org.wildfly.core/wildfly-controller

while (monitorEnumeration.hasMoreElements()) {
  SimpleManagementPermission monitorPerm = (SimpleManagementPermission) monitorEnumeration.nextElement();
  monitorPermissions.put(monitorPerm.getActionEffect(), monitorPerm);
while (permissionEnumeration.hasMoreElements()) {
  SimpleManagementPermission basePerm = (SimpleManagementPermission) permissionEnumeration.nextElement();
  Action.ActionEffect actionEffect = basePerm.getActionEffect();
  CombinationManagementPermission combinedPermission = new CombinationManagementPermission(CombinationPolicy.PERMISSIVE, actionEffect);
  if (scopedPermissions == null) {
    scopedPermissions = new ManagementPermissionCollection(officialForm, CombinationManagementPermission.class);
  ManagementPermission scopedPerm = basePerm.createScopedPermission(scopingConstraint.getStandardConstraint(), constraintIndex);
  combinedPermission.addUnderlyingPermission(scopedBaseName, scopedPerm);
  if (monitorPerm != null) {
    combinedPermission.addUnderlyingPermission(scopedReadOnlyName,
        monitorPerm.createScopedPermission(scopingConstraint.getOutofScopeReadConstraint(), constraintIndex));
origin: org.wildfly/wildfly-controller

private synchronized Map<String, ManagementPermissionCollection> configureDefaultPermissions() {
  Map<String, ManagementPermissionCollection> result = new HashMap<String, ManagementPermissionCollection>();
  for (StandardRole standardRole : StandardRole.values()) {
    String officialForm = getOfficialForm(standardRole);
    ManagementPermissionCollection rolePerms = new ManagementPermissionCollection(officialForm, SimpleManagementPermission.class);
    for (Action.ActionEffect actionEffect : Action.ActionEffect.values()) {
      if (standardRole.isActionEffectAllowed(actionEffect)) {
        Constraint[] constraints = new Constraint[constraintFactories.size()];
        int i = 0;
        for (ConstraintFactory factory : this.constraintFactories) {
          constraints[i] = factory.getStandardUserConstraint(standardRole, actionEffect);
          i++;
        }
        rolePerms.add(new SimpleManagementPermission(actionEffect, constraints));
      }
    }
    result.put(officialForm, rolePerms);
  }
  return result;
}
origin: wildfly/wildfly-core

@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;
  ManagementPermission that = (ManagementPermission) o;
  return getActionEffect() == that.getActionEffect();
}
origin: org.wildfly/wildfly-controller

@Override
public boolean implies(Permission permission) {
  if (equals(permission)) {
    SimpleManagementPermission other = (SimpleManagementPermission) permission;
    // Validate constraints
    assert constraints.length == other.constraints.length : String.format("incompatible ManagementPermission; " +
        "differing constraint counts %d vs %d", constraints.length, other.constraints.length);
    Action.ActionEffect actionEffect = getActionEffect();
    for (int i = 0; i < constraints.length; i++) {
      Constraint ours = constraints[i];
      Constraint theirs = other.constraints[i];
      assert ours.getClass() == theirs.getClass() : "incompatible constraints: ours = " + ours.getClass() + " -- theirs = " + theirs.getClass();
      if (ours.violates(theirs, actionEffect)) {
        ControllerLogger.ACCESS_LOGGER.tracef("Constraints are violated for %s", actionEffect);
        return false;
      }
    }
    return true;
  }
  return false;
}
origin: org.wildfly.core/wildfly-controller

  public ManagementPermission createScopedPermission(Constraint constraint, int constraintIndex) {
    Constraint[] altered;
    if (constraintIndex == constraints.length) {
      altered = new Constraint[constraintIndex + 1];
      System.arraycopy(constraints, 0, altered, 0, constraints.length);
    } else {
      Constraint existing = constraints[constraintIndex];
      if (constraint.replaces(existing)) {
        altered = new Constraint[constraints.length];
        System.arraycopy(constraints, 0, altered, 0, constraints.length);
      } else {
        altered = new Constraint[constraintIndex + 1];
        if (constraintIndex == 0) {
          System.arraycopy(constraints, 0, altered, 1, constraints.length);
        } else {
          System.arraycopy(constraints, 0, altered, 0, constraintIndex);
          System.arraycopy(constraints, constraintIndex, altered, constraintIndex + 1, constraints.length - constraintIndex);
        }
      }
    }
    altered[constraintIndex] = constraint;
    return new SimpleManagementPermission(getActionEffect(), altered);
  }
}
origin: org.wildfly/wildfly-controller

while (monitorEnumeration.hasMoreElements()) {
  SimpleManagementPermission monitorPerm = (SimpleManagementPermission) monitorEnumeration.nextElement();
  monitorPermissions.put(monitorPerm.getActionEffect(), monitorPerm);
while (permissionEnumeration.hasMoreElements()) {
  SimpleManagementPermission basePerm = (SimpleManagementPermission) permissionEnumeration.nextElement();
  Action.ActionEffect actionEffect = basePerm.getActionEffect();
  CombinationManagementPermission combinedPermission = new CombinationManagementPermission(CombinationPolicy.PERMISSIVE, actionEffect);
  if (scopedPermissions == null) {
    scopedPermissions = new ManagementPermissionCollection(officialForm, CombinationManagementPermission.class);
  ManagementPermission scopedPerm = basePerm.createScopedPermission(scopingConstraint.getStandardConstraint(), constraintIndex);
  combinedPermission.addUnderlyingPermission(scopedBaseName, scopedPerm);
  if (monitorPerm != null) {
    combinedPermission.addUnderlyingPermission(scopedReadOnlyName,
        monitorPerm.createScopedPermission(scopingConstraint.getOutofScopeReadConstraint(), constraintIndex));
origin: wildfly/wildfly-core

private synchronized Map<String, ManagementPermissionCollection> configureDefaultPermissions() {
  Map<String, ManagementPermissionCollection> result = new HashMap<String, ManagementPermissionCollection>();
  for (StandardRole standardRole : StandardRole.values()) {
    String officialForm = getOfficialForm(standardRole);
    ManagementPermissionCollection rolePerms = new ManagementPermissionCollection(officialForm, SimpleManagementPermission.class);
    for (Action.ActionEffect actionEffect : Action.ActionEffect.values()) {
      if (standardRole.isActionEffectAllowed(actionEffect)) {
        Constraint[] constraints = new Constraint[constraintFactories.size()];
        int i = 0;
        for (ConstraintFactory factory : this.constraintFactories) {
          constraints[i] = factory.getStandardUserConstraint(standardRole, actionEffect);
          i++;
        }
        rolePerms.add(new SimpleManagementPermission(actionEffect, constraints));
      }
    }
    result.put(officialForm, rolePerms);
  }
  return result;
}
origin: org.wildfly/wildfly-controller

@Override
public int hashCode() {
  return getActionEffect().hashCode();
}
origin: wildfly/wildfly-core

@Override
public boolean implies(Permission permission) {
  if (equals(permission)) {
    SimpleManagementPermission other = (SimpleManagementPermission) permission;
    // Validate constraints
    assert constraints.length == other.constraints.length : String.format("incompatible ManagementPermission; " +
        "differing constraint counts %d vs %d", constraints.length, other.constraints.length);
    Action.ActionEffect actionEffect = getActionEffect();
    for (int i = 0; i < constraints.length; i++) {
      Constraint ours = constraints[i];
      Constraint theirs = other.constraints[i];
      assert ours.getClass() == theirs.getClass() : "incompatible constraints: ours = " + ours.getClass() + " -- theirs = " + theirs.getClass();
      if (ours.violates(theirs, actionEffect)) {
        ControllerLogger.ACCESS_LOGGER.tracef("Constraints are violated for %s", actionEffect);
        return false;
      }
    }
    return true;
  }
  return false;
}
origin: wildfly/wildfly-core

  public ManagementPermission createScopedPermission(Constraint constraint, int constraintIndex) {
    Constraint[] altered;
    if (constraintIndex == constraints.length) {
      altered = new Constraint[constraintIndex + 1];
      System.arraycopy(constraints, 0, altered, 0, constraints.length);
    } else {
      Constraint existing = constraints[constraintIndex];
      if (constraint.replaces(existing)) {
        altered = new Constraint[constraints.length];
        System.arraycopy(constraints, 0, altered, 0, constraints.length);
      } else {
        altered = new Constraint[constraintIndex + 1];
        if (constraintIndex == 0) {
          System.arraycopy(constraints, 0, altered, 1, constraints.length);
        } else {
          System.arraycopy(constraints, 0, altered, 0, constraintIndex);
          System.arraycopy(constraints, constraintIndex, altered, constraintIndex + 1, constraints.length - constraintIndex);
        }
      }
    }
    altered[constraintIndex] = constraint;
    return new SimpleManagementPermission(getActionEffect(), altered);
  }
}
origin: org.wildfly.core/wildfly-controller

@Override
public PermissionCollection getRequiredPermissions(Action action, TargetAttribute target) {
  PermsHolder currentPerms = configureRolePermissions();
  ConstraintFactory[] currentFactories = currentPerms.constraintFactories;
  ManagementPermissionCollection result = new ManagementPermissionCollection(SimpleManagementPermission.class);
  for (Action.ActionEffect actionEffect : action.getActionEffects()) {
    Constraint[] constraints = new Constraint[currentFactories.length];
    for (int i = 0; i < constraints.length; i++) {
      constraints[i] = currentFactories[i].getRequiredConstraint(actionEffect, action, target);
    }
    result.add(new SimpleManagementPermission(actionEffect, constraints));
  }
  return result;
}
origin: org.wildfly/wildfly-controller

@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;
  ManagementPermission that = (ManagementPermission) o;
  return getActionEffect() == that.getActionEffect();
}
origin: org.wildfly/wildfly-controller

@Override
public PermissionCollection getRequiredPermissions(Action action, TargetResource target) {
  PermsHolder currentPerms = configureRolePermissions();
  ConstraintFactory[] currentFactories = currentPerms.constraintFactories;
  ManagementPermissionCollection result = new ManagementPermissionCollection(SimpleManagementPermission.class);
  for (Action.ActionEffect actionEffect : action.getActionEffects()) {
    Constraint[] constraints = new Constraint[currentFactories.length];
    for (int i = 0; i < constraints.length; i++) {
      constraints[i] = currentFactories[i].getRequiredConstraint(actionEffect, action, target);
    }
    result.add(new SimpleManagementPermission(actionEffect, constraints));
  }
  return result;
}
origin: wildfly/wildfly-core

@Override
public String getActions() {
  return getActionEffect().toString();
}
origin: wildfly/wildfly-core

@Override
public PermissionCollection getRequiredPermissions(JmxAction action, JmxTarget target) {
  PermsHolder currentPerms = configureRolePermissions();
  ConstraintFactory[] currentFactories = currentPerms.constraintFactories;
  ManagementPermissionCollection result = new ManagementPermissionCollection(SimpleManagementPermission.class);
  for (Action.ActionEffect actionEffect : action.getActionEffects()) {
    Constraint[] constraints = new Constraint[currentFactories.length];
    for (int i = 0; i < constraints.length; i++) {
      constraints[i] = currentFactories[i].getRequiredConstraint(actionEffect, action, target);
    }
    result.add(new SimpleManagementPermission(actionEffect, constraints));
  }
  return result;
}
org.jboss.as.controller.access.permissionSimpleManagementPermission

Javadoc

Simple implementation of ManagementPermission.

Most used methods

  • <init>
  • createScopedPermission
  • equals
  • getActionEffect

Popular in Java

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • onRequestPermissionsResult (Fragment)
  • addToBackStack (FragmentTransaction)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now