Example usage for com.liferay.portal.kernel.model Group isUserPersonalSite

List of usage examples for com.liferay.portal.kernel.model Group isUserPersonalSite

Introduction

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

Prototype

public boolean isUserPersonalSite();

Source Link

Usage

From source file:com.liferay.roles.admin.internal.exportimport.data.handler.ImportExportPermissionConversionFilter.java

License:Open Source License

@Override
public boolean accept(Role role, ResourcePermission resourcePermission) {
    int scope = resourcePermission.getScope();

    if ((scope == ResourceConstants.SCOPE_COMPANY) || (scope == ResourceConstants.SCOPE_GROUP_TEMPLATE)) {

        return true;
    } else if (resourcePermission.getScope() == ResourceConstants.SCOPE_GROUP) {

        Group group = GroupLocalServiceUtil.fetchGroup(Long.valueOf(resourcePermission.getPrimKey()));

        if (group.isCompany() || group.isUserPersonalSite()) {
            return true;
        }//from w ww .  j  ava 2 s . c  o  m
    }

    return false;
}

From source file:com.liferay.roles.admin.internal.exportimport.data.handler.ImportExportPermissionConversionFilter.java

License:Open Source License

@Override
public boolean accept(Role role, ResourceTypePermission resourceTypePermission) {

    if (role.getType() != RoleConstants.TYPE_REGULAR) {
        return true;
    } else if (resourceTypePermission.isCompanyScope()) {
        return true;
    }/*from ww w .j  av  a 2s.c  o m*/

    Group group = GroupLocalServiceUtil.fetchGroup(resourceTypePermission.getGroupId());

    if ((group != null) && (group.isCompany() || group.isUserPersonalSite())) {

        return true;
    }

    return false;
}