Package org.sonatype.security.rest.model

Examples of org.sonatype.security.rest.model.PrivilegeProperty


  public PrivilegeStatusResource securityToRestModel(Privilege privilege, Request request, boolean appendResourceId) {
    PrivilegeStatusResource resource = new PrivilegeStatusResource();

    for (Entry<String, String> prop : privilege.getProperties().entrySet()) {
      PrivilegeProperty privProp = new PrivilegeProperty();
      privProp.setKey(prop.getKey());
      privProp.setValue(prop.getValue());

      resource.addProperty(privProp);
    }

    resource.setType(privilege.getType());
View Full Code Here


        property.setValue(value);
        return;
      }
    }

    final PrivilegeProperty property = new PrivilegeProperty();
    property.setKey(key);
    property.setValue(value);
    properties.add(property);
  }
View Full Code Here

    appResource1.setResourceURI("ResourceURI1");
    appResource1.setName("Name1");
    appResource1.setDescription("Description1");
    appResource1.setType(ApplicationPrivilegeDescriptor.TYPE);

    PrivilegeProperty prop = new PrivilegeProperty();
    prop.setKey(ApplicationPrivilegeMethodPropertyDescriptor.ID);
    prop.setValue("Method1");
    appResource1.addProperty(prop);

    prop = new PrivilegeProperty();
    prop.setKey(ApplicationPrivilegePermissionPropertyDescriptor.ID);
    prop.setValue("Permission1");
    appResource1.addProperty(prop);

    PrivilegeStatusResource appResource2 = new PrivilegeStatusResource();
    appResource2.setId("Id2");
    appResource2.setResourceURI("ResourceURI2");
    appResource2.setName("Name2");
    appResource2.setDescription("Description2");
    appResource2.setType(ApplicationPrivilegeDescriptor.TYPE);

    prop = new PrivilegeProperty();
    prop.setKey(ApplicationPrivilegeMethodPropertyDescriptor.ID);
    prop.setValue("Method2");
    appResource2.addProperty(prop);

    prop = new PrivilegeProperty();
    prop.setKey(ApplicationPrivilegePermissionPropertyDescriptor.ID);
    prop.setValue("Permission2");
    appResource2.addProperty(prop);

    PrivilegeStatusResource targetResource1 = new PrivilegeStatusResource();
    targetResource1.setId("Id1");
    targetResource1.setResourceURI("ResourceURI1");
    targetResource1.setName("Name1");
    targetResource1.setDescription("Description1");
    targetResource1.setType(TargetPrivilegeDescriptor.TYPE);

    prop = new PrivilegeProperty();
    prop.setKey(TargetPrivilegeGroupPropertyDescriptor.ID);
    prop.setValue("RepositoryGroupId1");
    targetResource1.addProperty(prop);

    prop = new PrivilegeProperty();
    prop.setKey(TargetPrivilegeRepositoryPropertyDescriptor.ID);
    prop.setValue("RepositoryId1");
    targetResource1.addProperty(prop);

    prop = new PrivilegeProperty();
    prop.setKey(TargetPrivilegeRepositoryTargetPropertyDescriptor.ID);
    prop.setValue("RepositoryTargetId1");
    targetResource1.addProperty(prop);

    prop = new PrivilegeProperty();
    prop.setKey(ApplicationPrivilegeMethodPropertyDescriptor.ID);
    prop.setValue("Method1");
    targetResource1.addProperty(prop);

    PrivilegeStatusResource targetResource2 = new PrivilegeStatusResource();
    targetResource2.setId("Id2");
    targetResource2.setResourceURI("ResourceURI2");
    targetResource2.setName("Name2");
    targetResource2.setDescription("Description2");
    targetResource2.setType(TargetPrivilegeDescriptor.TYPE);

    prop = new PrivilegeProperty();
    prop.setKey(TargetPrivilegeGroupPropertyDescriptor.ID);
    prop.setValue("RepositoryGroupId2");
    targetResource2.addProperty(prop);

    prop = new PrivilegeProperty();
    prop.setKey(TargetPrivilegeRepositoryPropertyDescriptor.ID);
    prop.setValue("RepositoryId2");
    targetResource2.addProperty(prop);

    prop = new PrivilegeProperty();
    prop.setKey(TargetPrivilegeRepositoryTargetPropertyDescriptor.ID);
    prop.setValue("RepositoryTargetId2");
    targetResource2.addProperty(prop);

    prop = new PrivilegeProperty();
    prop.setKey(ApplicationPrivilegeMethodPropertyDescriptor.ID);
    prop.setValue("Method2");
    targetResource2.addProperty(prop);

    resourceResponse.addData(appResource1);
    resourceResponse.addData(targetResource1);
    resourceResponse.addData(appResource2);
View Full Code Here

    appResource1.setResourceURI("ResourceURI1");
    appResource1.setName("Name1");
    appResource1.setDescription("Description1");
    appResource1.setType(ApplicationPrivilegeDescriptor.TYPE);

    PrivilegeProperty prop = new PrivilegeProperty();
    prop.setKey(ApplicationPrivilegePermissionPropertyDescriptor.ID);
    prop.setValue("Permission1");
    appResource1.addProperty(prop);

    prop = new PrivilegeProperty();
    prop.setKey(ApplicationPrivilegeMethodPropertyDescriptor.ID);
    prop.setValue("Method1");
    appResource1.addProperty(prop);

    PrivilegeStatusResourceResponse resourceResponse = new PrivilegeStatusResourceResponse();
    resourceResponse.setData(appResource1);

    this.marshalUnmarchalThenCompare(resourceResponse);
    this.validateXmlHasNoPackageNames(resourceResponse);

    PrivilegeStatusResource targetResource1 = new PrivilegeStatusResource();
    targetResource1.setId("Id1");
    targetResource1.setResourceURI("ResourceURI1");
    targetResource1.setName("Name1");
    targetResource1.setDescription("Description1");
    targetResource1.setType(TargetPrivilegeDescriptor.TYPE);

    prop = new PrivilegeProperty();
    prop.setKey(TargetPrivilegeGroupPropertyDescriptor.ID);
    prop.setValue("RepositoryGroupId1");
    targetResource1.addProperty(prop);

    prop = new PrivilegeProperty();
    prop.setKey(TargetPrivilegeRepositoryPropertyDescriptor.ID);
    prop.setValue("RepositoryId1");
    targetResource1.addProperty(prop);

    prop = new PrivilegeProperty();
    prop.setKey(TargetPrivilegeRepositoryTargetPropertyDescriptor.ID);
    prop.setValue("RepositoryTargetId1");
    targetResource1.addProperty(prop);

    prop = new PrivilegeProperty();
    prop.setKey(ApplicationPrivilegeMethodPropertyDescriptor.ID);
    prop.setValue("Method1");
    targetResource1.addProperty(prop);

    resourceResponse = new PrivilegeStatusResourceResponse();
    resourceResponse.setData(targetResource1);
View Full Code Here

TOP

Related Classes of org.sonatype.security.rest.model.PrivilegeProperty

Copyright © 2018 www.massapicom. 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.