1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kim.impl.permission |
17 | |
|
18 | |
|
19 | |
|
20 | |
import org.apache.commons.lang.StringUtils |
21 | |
import org.kuali.rice.kim.api.KimConstants |
22 | |
import org.kuali.rice.kim.api.identity.Person |
23 | |
import org.kuali.rice.kim.impl.group.GroupBo |
24 | |
import org.kuali.rice.kim.impl.role.RoleBo |
25 | |
import org.springframework.util.AutoPopulatingList |
26 | |
import org.kuali.rice.kim.api.permission.Permission |
27 | |
|
28 | |
|
29 | |
class UberPermissionBo extends PermissionBo { |
30 | |
|
31 | |
private static final long serialVersionUID = 1L |
32 | |
|
33 | 0 | List<RoleBo> assignedToRoles = new AutoPopulatingList(RoleBo.class) |
34 | |
String assignedToRoleNamespaceForLookup |
35 | |
String assignedToRoleNameForLookup |
36 | |
RoleBo assignedToRole |
37 | |
String assignedToPrincipalNameForLookup |
38 | |
Person assignedToPrincipal |
39 | |
String assignedToGroupNamespaceForLookup |
40 | |
String assignedToGroupNameForLookup |
41 | |
GroupBo assignedToGroup |
42 | |
String attributeName |
43 | |
String attributeValue |
44 | |
String detailCriteria |
45 | |
|
46 | |
public static UberPermissionBo from(PermissionBo bo) { |
47 | 0 | if (bo == null) { |
48 | 0 | return null |
49 | |
} |
50 | 0 | Permission.Builder builder = Permission.Builder.create(bo) |
51 | 0 | return (UberPermissionBo) PermissionBo.from(builder.build()) |
52 | |
|
53 | |
} |
54 | |
public String getAssignedToRolesToDisplay() { |
55 | 0 | StringBuffer assignedToRolesText = new StringBuffer() |
56 | 0 | for (RoleBo roleImpl: assignedToRoles) { |
57 | 0 | assignedToRolesText.append(roleImpl.namespaceCode.trim() |
58 | 0 | + " " |
59 | 0 | + roleImpl.name.trim() |
60 | |
+ KimConstants.KimUIConstants.COMMA_SEPARATOR) |
61 | |
} |
62 | 0 | return StringUtils.chomp(assignedToRolesText.toString(), KimConstants.KimUIConstants.COMMA_SEPARATOR) |
63 | |
} |
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
} |
70 | |
|