use of org.opencastproject.message.broker.api.acl.AclItem in project opencast by opencast.
the class AclServiceImpl method updateAcl.
@Override
public boolean updateAcl(ManagedAcl acl) {
Option<ManagedAcl> oldName = getAcl(acl.getId());
boolean updateAcl = aclDb.updateAcl(acl);
if (updateAcl) {
if (oldName.isSome() && !(oldName.get().getName().equals(acl.getName()))) {
AclItem aclItem = AclItem.update(oldName.get().getName(), acl.getName());
messageSender.sendObjectMessage(AclItem.ACL_QUEUE, MessageSender.DestinationType.Queue, aclItem);
}
}
return updateAcl;
}
use of org.opencastproject.message.broker.api.acl.AclItem in project opencast by opencast.
the class AclServiceImpl method createAcl.
@Override
public Option<ManagedAcl> createAcl(AccessControlList acl, String name) {
Option<ManagedAcl> createAcl = aclDb.createAcl(organization, acl, name);
if (createAcl.isSome()) {
AclItem aclItem = AclItem.create(createAcl.get().getName());
messageSender.sendObjectMessage(AclItem.ACL_QUEUE, MessageSender.DestinationType.Queue, aclItem);
}
return createAcl;
}
use of org.opencastproject.message.broker.api.acl.AclItem in project opencast by opencast.
the class AclServiceImpl method deleteAcl.
@Override
public boolean deleteAcl(long id) throws AclServiceException, NotFoundException {
final TransitionQuery query = TransitionQuery.query().withDone(false).withAclId(id);
final TransitionResult result = persistence.getByQuery(organization, query);
if (result.getEpisodeTransistions().size() > 0 || result.getSeriesTransistions().size() > 0)
return false;
Option<ManagedAcl> deletedAcl = getAcl(id);
if (aclDb.deleteAcl(organization, id)) {
if (deletedAcl.isSome()) {
AclItem aclItem = AclItem.delete(deletedAcl.get().getName());
messageSender.sendObjectMessage(AclItem.ACL_QUEUE, MessageSender.DestinationType.Queue, aclItem);
}
return true;
}
throw new NotFoundException("Managed acl with id " + id + " not found.");
}
Aggregations