mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
. Fix for issue identified by Steve on Friday
- to handle that "Guest" is not Person from personService.personExists() but it is a Person if you call personService.getPerson()… (very odd) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2351 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -529,7 +529,8 @@ public final class Repository
|
||||
// this will also force initialisation of the props now during the UserTransaction
|
||||
// it is much better for performance to do this now rather than during page bind
|
||||
Map<String, Object> props = node.getProperties();
|
||||
props.put("fullName", ((String)props.get("firstName")) + ' ' + ((String)props.get("lastName")));
|
||||
String lastName = (String)props.get("lastName");
|
||||
props.put("fullName", ((String)props.get("firstName")) + ' ' + (lastName != null ? lastName : ""));
|
||||
NodeRef homeFolderNodeRef = (NodeRef)props.get("homeFolder");
|
||||
if (homeFolderNodeRef != null)
|
||||
{
|
||||
|
@@ -84,8 +84,9 @@ public final class User
|
||||
{
|
||||
if (this.fullName == null)
|
||||
{
|
||||
this.fullName = service.getProperty(this.person, ContentModel.PROP_FIRSTNAME) + " " +
|
||||
service.getProperty(this.person, ContentModel.PROP_LASTNAME);
|
||||
String lastName = (String)service.getProperty(this.person, ContentModel.PROP_LASTNAME);
|
||||
this.fullName = service.getProperty(this.person, ContentModel.PROP_FIRSTNAME) +
|
||||
(lastName != null ? (" " + lastName) : "");
|
||||
}
|
||||
|
||||
return this.fullName;
|
||||
|
@@ -312,7 +312,8 @@ public abstract class UserMembersBean
|
||||
for (String authority : permissionMap.keySet())
|
||||
{
|
||||
// check if we are dealing with a person (User Authority)
|
||||
if (personService.personExists(authority))
|
||||
if (AuthorityType.getAuthorityType(authority) == AuthorityType.GUEST ||
|
||||
personService.personExists(authority))
|
||||
{
|
||||
NodeRef nodeRef = personService.getPerson(authority);
|
||||
if (nodeRef != null)
|
||||
@@ -325,9 +326,7 @@ public abstract class UserMembersBean
|
||||
// it is much better for performance to do this now rather than during page bind
|
||||
Map<String, Object> props = node.getProperties();
|
||||
props.put("fullName", ((String)props.get("firstName")) + ' ' + ((String)props.get("lastName")));
|
||||
|
||||
props.put("roles", listToString(context, permissionMap.get(authority)));
|
||||
|
||||
props.put("icon", WebResources.IMAGE_PERSON);
|
||||
|
||||
personNodes.add(node);
|
||||
@@ -337,7 +336,14 @@ public abstract class UserMembersBean
|
||||
{
|
||||
// need a map (dummy node) to represent props for this Group Authority
|
||||
Map<String, Object> node = new HashMap<String, Object>(5, 1.0f);
|
||||
if (authority.startsWith(PermissionService.GROUP_PREFIX) == true)
|
||||
{
|
||||
node.put("fullName", authority.substring(PermissionService.GROUP_PREFIX.length()));
|
||||
}
|
||||
else
|
||||
{
|
||||
node.put("fullName", authority);
|
||||
}
|
||||
node.put("userName", authority);
|
||||
node.put("id", authority);
|
||||
node.put("roles", listToString(context, permissionMap.get(authority)));
|
||||
|
@@ -457,9 +457,9 @@ public abstract class InviteUsersWizard extends AbstractWizardBean
|
||||
|
||||
// build a display label showing the user and their role for the space
|
||||
AuthorityType authType = AuthorityType.getAuthorityType(authority);
|
||||
if (authType.equals(AuthorityType.USER) || authType.equals(AuthorityType.GUEST))
|
||||
if (authType == AuthorityType.GUEST || authType == AuthorityType.USER)
|
||||
{
|
||||
if (this.personService.personExists(authority) == true)
|
||||
if (authType == AuthorityType.GUEST || this.personService.personExists(authority) == true)
|
||||
{
|
||||
// found a User authority
|
||||
NodeRef ref = this.personService.getPerson(authority);
|
||||
@@ -468,7 +468,7 @@ public abstract class InviteUsersWizard extends AbstractWizardBean
|
||||
|
||||
label.append(firstName)
|
||||
.append(" ")
|
||||
.append(lastName)
|
||||
.append(lastName != null ? lastName : "")
|
||||
.append(" (")
|
||||
.append(Application.getMessage(FacesContext.getCurrentInstance(), role))
|
||||
.append(")");
|
||||
|
Reference in New Issue
Block a user