@Override public String getURL(PortletRequest portletRequest, PortletResponse portletResponse) { String url = StringPool.BLANK; ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY); try { long roleId = _getRoleId(portletRequest); Role role = _roleService.fetchRole(roleId); int[] roleTypes = {role.getType()}; if (role.getType() != RoleConstants.TYPE_REGULAR) { roleTypes = new int[] {RoleConstants.TYPE_REGULAR, role.getType()}; } url = PermissionsURLTag.doTag( StringPool.BLANK, Role.class.getName(), themeDisplay.getScopeGroupName(), null, String.valueOf(_getRoleId(portletRequest)), LiferayWindowState.POP_UP.toString(), roleTypes, themeDisplay.getRequest()); } catch (Exception e) { } return url; }
protected boolean isValidAssignment(KaleoTaskAssignment kaleoTaskAssignment, Group group) throws PortalException { long roleId = kaleoTaskAssignment.getAssigneeClassPK(); Role role = _roleLocalService.getRole(roleId); if (role.getType() == RoleConstants.TYPE_REGULAR) { return true; } else if ((group != null) && group.isOrganization() && (role.getType() == RoleConstants.TYPE_ORGANIZATION)) { return true; } else if ((group != null) && group.isSite() && (role.getType() == RoleConstants.TYPE_SITE)) { return true; } return false; }