RM-690 (A records admin is able to add a user or group to a role from the management console)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@50134 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2013-05-18 15:54:37 +00:00
parent b3120dddff
commit aceef2fa2f
4 changed files with 119 additions and 81 deletions

View File

@@ -30,6 +30,9 @@
}<#if group_has_next>,</#if>
</#list>
]
<#if role.groupShortName??>
,"groupShortName": "${role.groupShortName}"
</#if>
</#if>
}
</#escape>

View File

@@ -441,10 +441,12 @@ public class FilePlanRoleServiceImpl implements FilePlanRoleService,
Set<String> users = authorityService.getContainedAuthorities(AuthorityType.USER, roleAuthority, false);
if (users.contains(user) == true)
{
String name = getShortRoleName(authorityService.getShortName(roleAuthority), rmRootNode);
String groupShortName = authorityService.getShortName(roleAuthority);
String name = getShortRoleName(groupShortName, rmRootNode);
String displayLabel = authorityService.getAuthorityDisplayName(roleAuthority);
Set<Capability> capabilities = getCapabilitiesImpl(rmRootNode, roleAuthority);
Role role = new Role(name, displayLabel, getCapabilitiesImpl(rmRootNode, roleAuthority), roleAuthority);
Role role = new Role(name, displayLabel, capabilities, roleAuthority, groupShortName);
result.add(role);
}
}

View File

@@ -41,10 +41,14 @@ public class Role
/** Role group name */
private String roleGroupName;
/** Role group short name */
private String groupShortName;
/**
* @param name
* @param displayLabel
* @param capabilities
* @param roleGroupName
*/
public Role(String name, String displayLabel, Set<Capability> capabilities, String roleGroupName)
{
@@ -54,6 +58,19 @@ public class Role
this.roleGroupName = roleGroupName;
}
/**
* @param name
* @param displayLabel
* @param capabilities
* @param roleGroupName
* @param groupShortName
*/
public Role(String name, String displayLabel, Set<Capability> capabilities, String roleGroupName, String groupShortName)
{
this(name, displayLabel, capabilities, roleGroupName);
this.groupShortName = groupShortName;
}
/**
* @return the name
*/
@@ -85,4 +102,13 @@ public class Role
{
return roleGroupName;
}
/**
* @return the groupShortName
*/
public String getGroupShortName()
{
return this.groupShortName;
}
}

View File

@@ -188,6 +188,7 @@ public class RoleDeclarativeWebScript extends DeclarativeWebScript
public class RoleItem
{
private String name;
private String groupShortName;
private String displayLabel;
private Set<Capability> capabilities;
private boolean showAuths = false;
@@ -204,6 +205,7 @@ public class RoleDeclarativeWebScript extends DeclarativeWebScript
public RoleItem(Role role, Set<AuthorityItem> assignedUsers, Set<AuthorityItem> assignedGroups)
{
this.name = role.getName();
this.groupShortName = role.getGroupShortName();
this.displayLabel = role.getDisplayLabel();
this.capabilities = role.getCapabilities();
this.showAuths = true;
@@ -216,6 +218,11 @@ public class RoleDeclarativeWebScript extends DeclarativeWebScript
return name;
}
public String getGroupShortName()
{
return groupShortName;
}
public String getDisplayLabel()
{
return displayLabel;