- adds attribute 'description' to ng-object-class Role, used for export to ng

git-svn-id: https://svn.libreccm.org/ccm/trunk@4405 8810af33-2d31-482b-a856-94f89814c4df
master
tosmers 2016-10-24 17:46:03 +00:00
parent 8c3ecb49e1
commit 0e2c58600d
1 changed files with 7 additions and 0 deletions

View File

@ -21,12 +21,14 @@ package com.arsdigita.portation.modules.core.security;
import com.arsdigita.portation.AbstractMarshaller; import com.arsdigita.portation.AbstractMarshaller;
import com.arsdigita.portation.Identifiable; import com.arsdigita.portation.Identifiable;
import com.arsdigita.portation.conversion.NgCollection; import com.arsdigita.portation.conversion.NgCollection;
import com.arsdigita.portation.modules.core.l10n.LocalizedString;
import com.arsdigita.portation.modules.core.workflow.TaskAssignment; import com.arsdigita.portation.modules.core.workflow.TaskAssignment;
import com.fasterxml.jackson.annotation.JsonManagedReference; import com.fasterxml.jackson.annotation.JsonManagedReference;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Set; import java.util.Set;
/** /**
@ -37,6 +39,7 @@ public class Role implements Identifiable {
private long roleId; private long roleId;
private String name; private String name;
private LocalizedString description;
@JsonManagedReference @JsonManagedReference
private Set<RoleMembership> memberships; private Set<RoleMembership> memberships;
@ -49,6 +52,9 @@ public class Role implements Identifiable {
public Role(final com.arsdigita.kernel.Role trunkRole) { public Role(final com.arsdigita.kernel.Role trunkRole) {
this.roleId = trunkRole.getID().longValue(); this.roleId = trunkRole.getID().longValue();
this.name = trunkRole.getName(); this.name = trunkRole.getName();
Locale local = Locale.getDefault();
this.description = new LocalizedString();
this.description.addValue(local, trunkRole.getDescription());
this.memberships = new HashSet<>(); this.memberships = new HashSet<>();
@ -61,6 +67,7 @@ public class Role implements Identifiable {
public Role(final String name) { public Role(final String name) {
this.roleId = NgCollection.roles.size() + 1; this.roleId = NgCollection.roles.size() + 1;
this.name = name; this.name = name;
this.description = new LocalizedString();
this.memberships = new HashSet<>(); this.memberships = new HashSet<>();