Foren

Team membership allowed, why not sub-organizations also?

Zenobia L, geändert vor 12 Jahren.

Team membership allowed, why not sub-organizations also?

Junior Member Beiträge: 28 Beitrittsdatum: 08.04.11 Neueste Beiträge
In R6.0,
Within an Organization, Team's members can be:
- Users (that belong to the organization)
- or User-Groups

Why not sub-organizations that belong to the Organization?

In R6.1,
Within a Site, Team's members can be:
- Users (who are members of the Site)
- or User-Groups

Why not sub-organizations who are members of the Site?

Thank you
Zenobia L, geändert vor 12 Jahren.

RE: Team membership allowed, why not sub-organizations also?

Junior Member Beiträge: 28 Beitrittsdatum: 08.04.11 Neueste Beiträge
Update:

I made some modifications to the portlet who assigns members to a team, to let not only user-groups to be a member but also sub-organizations of the team's organization,
I didn't change any class in the service side, just using what is available, and it is working,
However it didn't work for the organization-owner, only for the administrator role, and we want the organization-owner to be able to assign his/her sub-organizations as members of the teams he/she is creating. After debugging and looking a the service code, I found out that the GroupServiceImpl java class is checking for the ROLE.UPDATE permission when assigning a role to a group, which I think is not correct... the services classes that assign a role to a user-group do not check for the ROLE.UPDATE permission, but the services that assign a froup to a role do.. (I created a JIRA issue http://issues.liferay.com/browse/LPS-25178 )

I may need to make a modification in the GroupServiceImpl class also
Zenobia L, geändert vor 12 Jahren.

RE: Team membership allowed, why not sub-organizations also?

Junior Member Beiträge: 28 Beitrittsdatum: 08.04.11 Neueste Beiträge
Update...

I made the modifications and it is working!

- portlet\sites_adminedit_team_assignments.jsp (modified to add one more tab for sub-organizations)
- portlet\sites_adminedit_team_assignments_suborganizations.jsp (added)
this JSP calls the existing EditRoleAssignmentsAction to update the GROUPS_ROLES table by using the Team's RoleId and the Sub-Organization's GroupId
- created a hook-wrapper to override the com.liferay.portal.service.impl.GroupServiceImpl methods, to check security differently

public class ExtGroupServiceImpl extends GroupServiceWrapper {
public ExtGroupServiceImpl(GroupService groupService) {
super(groupService);
}

@Override
public void addRoleGroups(long roleId, long[] groupIds)
throws PortalException, SystemException {
PermissionChecker permissionChecker =
PermissionThreadLocal.getPermissionChecker();
if (permissionChecker == null) {
throw new PrincipalException("PermissionChecker not initialized");
}
for (int i = 0; i < groupIds.length; i++) {
if (!permissionChecker.isGroupOwner(groupIds)) {
throw new PrincipalException();
}
}
GroupLocalServiceUtil.addRoleGroups(roleId, groupIds);

}