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