relationshipManager.remove(grant);
relationshipManager.remove(grant);
@Override protected void doRemove(IdentityType attributedType) { RelationshipQuery<Relationship> query = this.relationshipManager.createRelationshipQuery(Relationship.class); query.setParameter(Relationship.IDENTITY, attributedType); for (Relationship relationship : query.getResultList()) { this.relationshipManager.remove(relationship); } if (this.permissionManager != null) { List<Permission> permissions = this.permissionManager.listPermissions(attributedType); for (Permission permission : permissions) { this.permissionManager.revokePermission(attributedType, permission.getResourceClass(), permission.getOperation()); } } IdentityContext identityContext = getIdentityContext(); getStoreSelector().getStoreForIdentityOperation(identityContext, IdentityStore.class, attributedType.getClass(), IdentityOperation.delete) .remove(identityContext, attributedType); }
@Override protected void doRemove(IdentityType attributedType) { RelationshipQuery<Relationship> query = this.relationshipManager.createRelationshipQuery(Relationship.class); query.setParameter(Relationship.IDENTITY, attributedType); for (Relationship relationship : query.getResultList()) { this.relationshipManager.remove(relationship); } if (this.permissionManager != null) { List<Permission> permissions = this.permissionManager.listPermissions(attributedType); for (Permission permission : permissions) { this.permissionManager.revokePermission(attributedType, permission.getResourceClass(), permission.getOperation()); } } IdentityContext identityContext = getIdentityContext(); getStoreSelector().getStoreForIdentityOperation(identityContext, IdentityStore.class, attributedType.getClass(), IdentityOperation.delete) .remove(identityContext, attributedType); }
/** * <p> Removes the given {@link Account} from the provided {@link Group}. </p> * * @param member A previously loaded {@link Account} instance. * @param group A previously loaded {@link Group} instance. * * @throws IdentityManagementException If the method fails. */ public static void removeFromGroup(RelationshipManager relationshipManager, Account member, Group group) throws IdentityManagementException { if (relationshipManager == null) { throw MESSAGES.nullArgument("RelationshipManager"); } if (member == null) { throw MESSAGES.nullArgument("Account"); } if (group == null) { throw MESSAGES.nullArgument("Group"); } RelationshipQuery<GroupMembership> query = relationshipManager.createRelationshipQuery(GroupMembership.class); query.setParameter(GroupMembership.MEMBER, member); query.setParameter(GroupMembership.GROUP, group); for (GroupMembership membership : query.getResultList()) { relationshipManager.remove(membership); } }
/** * <p> Removes the given {@link Account} from the provided {@link Group}. </p> * * @param member A previously loaded {@link Account} instance. * @param group A previously loaded {@link Group} instance. * * @throws IdentityManagementException If the method fails. */ public static void removeFromGroup(RelationshipManager relationshipManager, Account member, Group group) throws IdentityManagementException { if (relationshipManager == null) { throw MESSAGES.nullArgument("RelationshipManager"); } if (member == null) { throw MESSAGES.nullArgument("Account"); } if (group == null) { throw MESSAGES.nullArgument("Group"); } RelationshipQuery<GroupMembership> query = relationshipManager.createRelationshipQuery(GroupMembership.class); query.setParameter(GroupMembership.MEMBER, member); query.setParameter(GroupMembership.GROUP, group); for (GroupMembership membership : query.getResultList()) { relationshipManager.remove(membership); } }
relationshipManager.remove(groupRole);
relationshipManager.remove(groupRole);