use of com.enonic.xp.data.PropertyTree in project xp by enonic.
the class SecurityAuditLogSupportImpl method createIdProvider.
@Override
public void createIdProvider(final CreateIdProviderParams params) {
if (isEnabledAuditLogs) {
PropertyTree data = new PropertyTree();
PropertySet paramsSet = data.addSet("params");
paramsSet.setString("key", params.getKey().toString());
paramsSet.setString("displayName", params.getDisplayName());
paramsSet.setString("description", params.getDescription());
log("system.security.idProvider.create", data, AuditLogUris.from(params.getKey().toString()));
}
}
use of com.enonic.xp.data.PropertyTree in project xp by enonic.
the class SecurityAuditLogSupportImpl method updateUser.
@Override
public void updateUser(final UpdateUserParams params) {
if (isEnabledAuditLogs) {
PropertyTree data = new PropertyTree();
PropertySet paramsSet = data.addSet("params");
paramsSet.setString("key", params.getKey().toString());
paramsSet.setString("email", params.getEmail());
paramsSet.setString("login", params.getLogin());
paramsSet.setString("displayName", params.getDisplayName());
log("system.security.principal.update", data, AuditLogUris.from(params.getKey().toString()));
}
}
use of com.enonic.xp.data.PropertyTree in project xp by enonic.
the class SecurityAuditLogSupportImpl method removePrincipal.
@Override
public void removePrincipal(final PrincipalKey principalKey) {
if (isEnabledAuditLogs) {
PropertyTree data = new PropertyTree();
PropertySet paramsSet = data.addSet("params");
paramsSet.setString("key", principalKey.toString());
log("system.security.principal.delete", data, AuditLogUris.from(principalKey.toString()));
}
}
use of com.enonic.xp.data.PropertyTree in project xp by enonic.
the class SecurityAuditLogSupportImpl method addRelationship.
@Override
public void addRelationship(final PrincipalRelationship relationship) {
if (isEnabledAuditLogs) {
PropertyTree data = new PropertyTree();
PropertySet paramsSet = data.addSet("params");
paramsSet.setString("principal", relationship.getTo().toString());
paramsSet.setString("joins", relationship.getFrom().toString());
AuditLogUris auditLogUris = AuditLogUris.from(relationship.getTo().toString(), relationship.getFrom().toString());
log("system.security.principal.addRelationship", data, auditLogUris);
}
}
use of com.enonic.xp.data.PropertyTree in project xp by enonic.
the class GroupNodeTranslatorTest method toGroup.
@Test
public void toGroup() throws Exception {
final PrincipalKey groupKey = PrincipalKey.ofGroup(IdProviderKey.system(), "group-a");
final PropertyTree rootDataSet = new PropertyTree();
rootDataSet.setString(PrincipalPropertyNames.DISPLAY_NAME_KEY, "Group A");
rootDataSet.setString(PrincipalPropertyNames.PRINCIPAL_TYPE_KEY, groupKey.getType().toString());
rootDataSet.setString(PrincipalPropertyNames.ID_PROVIDER_KEY, groupKey.getIdProviderKey().toString());
final Node node = Node.create().id(NodeId.from("id")).name(PrincipalKeyNodeTranslator.toNodeName(groupKey)).data(rootDataSet).build();
final Group group = PrincipalNodeTranslator.groupFromNode(node);
assertEquals(groupKey, group.getKey());
}
Aggregations