Search in sources :

Example 1 with IndexItemString

use of com.enonic.xp.repo.impl.elasticsearch.document.indexitem.IndexItemString in project xp by enonic.

the class AccessControlListStoreDocumentFactory method create.

static List<IndexItem> create(final AccessControlList accessControlList) {
    final List<IndexItem> aclStoreDocumentItems = new ArrayList<>();
    for (final AccessControlEntry entry : accessControlList) {
        final Iterable<Permission> allowedPermissions = entry.getAllowedPermissions();
        final PrincipalKey principalKey = entry.getPrincipal();
        for (final Permission permission : allowedPermissions) {
            aclStoreDocumentItems.add(new IndexItemString(getPathForPermission(permission), principalKey.toString()));
        }
    }
    return aclStoreDocumentItems;
}
Also used : IndexItemString(com.enonic.xp.repo.impl.elasticsearch.document.indexitem.IndexItemString) ArrayList(java.util.ArrayList) Permission(com.enonic.xp.security.acl.Permission) AccessControlEntry(com.enonic.xp.security.acl.AccessControlEntry) PrincipalKey(com.enonic.xp.security.PrincipalKey) IndexItem(com.enonic.xp.repo.impl.elasticsearch.document.indexitem.IndexItem)

Aggregations

IndexItem (com.enonic.xp.repo.impl.elasticsearch.document.indexitem.IndexItem)1 IndexItemString (com.enonic.xp.repo.impl.elasticsearch.document.indexitem.IndexItemString)1 PrincipalKey (com.enonic.xp.security.PrincipalKey)1 AccessControlEntry (com.enonic.xp.security.acl.AccessControlEntry)1 Permission (com.enonic.xp.security.acl.Permission)1 ArrayList (java.util.ArrayList)1