use of com.enonic.xp.security.acl.AccessControlEntry in project xp by enonic.
the class PermissionsMapper method serialize.
@Override
public void serialize(final MapGenerator gen) {
gen.value(INHERITS_PERMISSIONS, node.inheritsPermissions());
if (!node.getPermissions().isEmpty()) {
gen.array(NodePropertyConstants.PERMISSIONS);
for (AccessControlEntry accessControlEntry : node.getPermissions()) {
gen.map();
serialize(gen, accessControlEntry);
gen.end();
}
gen.end();
}
}
use of com.enonic.xp.security.acl.AccessControlEntry in project xp by enonic.
the class PermissionsMapper method serialize.
@Override
public void serialize(final MapGenerator gen) {
gen.value("inheritsPermissions", content.inheritsPermissions());
if (!content.getPermissions().isEmpty()) {
gen.array("permissions");
for (AccessControlEntry accessControlEntry : content.getPermissions()) {
gen.map();
serialize(gen, accessControlEntry);
gen.end();
}
gen.end();
}
}
use of com.enonic.xp.security.acl.AccessControlEntry in project xp by enonic.
the class PermissionsFactoryTest method checkDenied.
private void checkDenied(final AccessControlList acl, final String principalKey, final Permission... denied) {
final AccessControlEntry principal = acl.getEntry(PrincipalKey.from(principalKey));
if (principal == null) {
fail("Missing entry for principal [" + principalKey + "]");
}
Arrays.stream(denied).forEach((entry) -> assertTrue(principal.isDenied(entry), "Should deny [" + entry + "]"));
}
use of com.enonic.xp.security.acl.AccessControlEntry in project xp by enonic.
the class ContentAuditLogSupportImpl method doCreateContent.
private void doCreateContent(final CreateContentParams params, final Content content, final Context rootContext) {
final PropertyTree data = new PropertyTree();
final PropertySet paramsSet = data.addSet("params");
final PropertySet resultSet = data.addSet("result");
paramsSet.addString("displayName", params.getDisplayName());
paramsSet.addString("type", nullToNull(params.getType()));
paramsSet.addString("name", nullToNull(params.getName()));
paramsSet.addBoolean("requireValid", params.isRequireValid());
paramsSet.addBoolean("inheritPermissions", params.isInheritPermissions());
if (params.getProcessedIds() != null) {
paramsSet.addStrings("processedIds", params.getProcessedIds().stream().map(ContentId::toString).collect(Collectors.toList()));
}
if (params.getPermissions() != null) {
paramsSet.addStrings("permissions", params.getPermissions().getEntries().stream().map(AccessControlEntry::toString).collect(Collectors.toList()));
}
addContent(resultSet, content);
log("system.content.create", data, content.getPath(), rootContext);
}
use of com.enonic.xp.security.acl.AccessControlEntry in project xp by enonic.
the class PermissionsXmlSerializer method serialize.
public void serialize() {
this.domBuilder.start("permissions");
for (final AccessControlEntry entry : this.accessControlList) {
serialize(entry);
}
this.domBuilder.end();
}
Aggregations