mirror of
https://github.com/sismics/docs.git
synced 2024-11-25 15:17:57 +01:00
richer acl event
This commit is contained in:
parent
1b3a33104a
commit
f9b61546ab
@ -29,8 +29,7 @@ public class AclCreatedAsyncListener {
|
||||
log.info("ACL created event: " + event.toString());
|
||||
}
|
||||
|
||||
TransactionUtil.handle(() -> {
|
||||
AppContext.getInstance().getIndexingHandler().createAcl(event.getSourceId());
|
||||
});
|
||||
TransactionUtil.handle(() -> AppContext.getInstance().getIndexingHandler()
|
||||
.createAcl(event.getSourceId(), event.getPerm(), event.getTargetId()));
|
||||
}
|
||||
}
|
||||
|
@ -29,8 +29,7 @@ public class AclDeletedAsyncListener {
|
||||
log.info("ACL deleted event: " + event.toString());
|
||||
}
|
||||
|
||||
TransactionUtil.handle(() -> {
|
||||
AppContext.getInstance().getIndexingHandler().deleteAcl(event.getSourceId());
|
||||
});
|
||||
TransactionUtil.handle(() -> AppContext.getInstance().getIndexingHandler()
|
||||
.deleteAcl(event.getSourceId(), event.getPerm(), event.getTargetId()));
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.sismics.docs.core.util.indexing;
|
||||
|
||||
import com.sismics.docs.core.constant.PermType;
|
||||
import com.sismics.docs.core.dao.criteria.DocumentCriteria;
|
||||
import com.sismics.docs.core.dao.dto.DocumentDto;
|
||||
import com.sismics.docs.core.model.jpa.Document;
|
||||
@ -74,15 +75,19 @@ public interface IndexingHandler {
|
||||
* Create an ACL.
|
||||
*
|
||||
* @param sourceId Source ID
|
||||
* @param perm Permission type
|
||||
* @param targetId Target ID
|
||||
*/
|
||||
void createAcl(String sourceId);
|
||||
void createAcl(String sourceId, PermType perm, String targetId);
|
||||
|
||||
/**
|
||||
* Delete an ACL.
|
||||
*
|
||||
* @param sourceId Source ID
|
||||
* @param perm Permission type
|
||||
* @param targetId Target ID
|
||||
*/
|
||||
void deleteAcl(String sourceId);
|
||||
void deleteAcl(String sourceId, PermType perm, String targetId);
|
||||
|
||||
/**
|
||||
* Searches documents by criteria.
|
||||
|
@ -4,6 +4,7 @@ import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.sismics.docs.core.constant.ConfigType;
|
||||
import com.sismics.docs.core.constant.PermType;
|
||||
import com.sismics.docs.core.dao.ConfigDao;
|
||||
import com.sismics.docs.core.dao.criteria.DocumentCriteria;
|
||||
import com.sismics.docs.core.dao.dto.DocumentDto;
|
||||
@ -169,12 +170,12 @@ public class LuceneIndexingHandler implements IndexingHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createAcl(String sourceId) {
|
||||
public void createAcl(String sourceId, PermType perm, String targetId) {
|
||||
// Lucene does not index ACLs
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAcl(String sourceId) {
|
||||
public void deleteAcl(String sourceId, PermType perm, String targetId) {
|
||||
// Lucene does not index ACLs
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user