Example usage for com.liferay.portal.kernel.model GroupConstants TYPE_SITE_RESTRICTED

List of usage examples for com.liferay.portal.kernel.model GroupConstants TYPE_SITE_RESTRICTED

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.model GroupConstants TYPE_SITE_RESTRICTED.

Prototype

int TYPE_SITE_RESTRICTED

To view the source code for com.liferay.portal.kernel.model GroupConstants TYPE_SITE_RESTRICTED.

Click Source Link

Usage

From source file:com.liferay.site.admin.web.internal.display.context.SiteAdminDisplayContext.java

License:Open Source License

public int getPendingRequestsCount(Group group) throws PortalException {
    int pendingRequests = 0;

    if (group.getType() == GroupConstants.TYPE_SITE_RESTRICTED) {
        pendingRequests = MembershipRequestLocalServiceUtil.searchCount(group.getGroupId(),
                MembershipRequestConstants.STATUS_PENDING);
    }/* w  ww  . ja v  a  2  s.  c  o m*/

    return pendingRequests;
}

From source file:com.liferay.site.admin.web.internal.display.context.SiteAdminDisplayContext.java

License:Open Source License

public boolean hasEditAssignmentsPermission(Group group, boolean organizationUser, boolean userGroupUser)
        throws PortalException {

    ThemeDisplay themeDisplay = (ThemeDisplay) _request.getAttribute(WebKeys.THEME_DISPLAY);

    User user = themeDisplay.getUser();//from w w  w . j av  a2  s  .  c  o  m

    if (!group.isCompany() && !(organizationUser || userGroupUser)
            && ((group.getType() == GroupConstants.TYPE_SITE_OPEN)
                    || (group.getType() == GroupConstants.TYPE_SITE_RESTRICTED))
            && GroupLocalServiceUtil.hasUserGroup(user.getUserId(), group.getGroupId())
            && !SiteMembershipPolicyUtil.isMembershipRequired(user.getUserId(), group.getGroupId())) {

        return true;
    }

    return false;
}

From source file:com.liferay.site.memberships.web.internal.portlet.configuration.icon.ViewMembershipRequestsPortletConfigurationIcon.java

License:Open Source License

@Override
public boolean isShow(PortletRequest portletRequest) {
    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    String tabs1 = ParamUtil.getString(portletRequest, "tabs1", "users");

    if (!tabs1.equals("users")) {
        return false;
    }/* ww w .j av  a  2  s  .c  o  m*/

    Group group = themeDisplay.getScopeGroup();

    if (group.getType() != GroupConstants.TYPE_SITE_RESTRICTED) {
        return false;
    }

    return true;
}

From source file:com.liferay.tool.datamanipulator.handler.portal.SiteHandler.java

License:Open Source License

private List<KeyValuePair> _getSiteTypes() throws SystemException {
    List<KeyValuePair> siteTypes = new ArrayList<KeyValuePair>();

    siteTypes.add(new KeyValuePair(GroupConstants.TYPE_SITE_OPEN_LABEL,
            String.valueOf(GroupConstants.TYPE_SITE_OPEN)));

    siteTypes.add(new KeyValuePair(GroupConstants.TYPE_SITE_PRIVATE_LABEL,
            String.valueOf(GroupConstants.TYPE_SITE_PRIVATE)));

    siteTypes.add(new KeyValuePair(GroupConstants.TYPE_SITE_RESTRICTED_LABEL,
            String.valueOf(GroupConstants.TYPE_SITE_RESTRICTED)));

    return siteTypes;
}