コード例 #1
0
 @Override
 public Role updateRole(Role r) {
   //        Set<OwnerPermission> newPermissions = new HashSet<OwnerPermission>();
   //        for (OwnerPermission incomingPerm : r.getPermissions()) {
   //            newPermissions.add(this.permCurator.findOrCreate(
   //                incomingPerm.getOwner(), incomingPerm.getAccess()));
   //        }
   //        r.getPermissions().clear();
   //        r.getPermissions().addAll(newPermissions);
   return roleCurator.merge(r);
 }
コード例 #2
0
  @Before
  public void setUp() {
    owner = ownerCurator.create(new Owner(OWNER_NAME));

    Role ownerAdminRole = createAdminRole(owner);
    roleCurator.create(ownerAdminRole);

    User user = new User("testing user", "pass");
    principal =
        new UserPrincipal(
            "testing user",
            new ArrayList<Permission>(
                permFactory.createPermissions(user, ownerAdminRole.getPermissions())),
            false);
    setupPrincipal(principal);

    ConsumerType ueberCertType = new ConsumerType(ConsumerTypeEnum.UEBER_CERT);
    consumerTypeCurator.create(ueberCertType);

    or =
        new OwnerResource(
            ownerCurator,
            null,
            consumerCurator,
            i18n,
            null,
            null,
            null,
            null,
            null,
            poolManager,
            null,
            null,
            null,
            null,
            consumerTypeCurator,
            entCertCurator,
            entitlementCurator,
            ueberCertGenerator,
            null,
            null,
            contentOverrideValidator,
            serviceLevelValidator,
            null,
            null,
            null,
            productManager,
            contentManager);
  }
コード例 #3
0
 @Override
 public List<Role> listRoles() {
   return roleCurator.listAll();
 }
コード例 #4
0
 @Override
 public void removeUserFromRole(Role role, User user) {
   role.removeUser(user);
   roleCurator.merge(role);
 }
コード例 #5
0
 @Override
 public void addUserToRole(Role role, User user) {
   role.addUser(user);
   roleCurator.merge(role);
 }
コード例 #6
0
 @Override
 public Role getRole(String roleId) {
   return roleCurator.find(roleId);
 }
コード例 #7
0
 @Override
 public void deleteRole(String roleId) {
   Role r = roleCurator.find(roleId);
   roleCurator.delete(r);
 }