Example usage for com.liferay.portal.kernel.security.permission ActionKeys PERMISSIONS

List of usage examples for com.liferay.portal.kernel.security.permission ActionKeys PERMISSIONS

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.security.permission ActionKeys PERMISSIONS.

Prototype

String PERMISSIONS

To view the source code for com.liferay.portal.kernel.security.permission ActionKeys PERMISSIONS.

Click Source Link

Usage

From source file:com.liferay.dynamic.data.mapping.form.web.internal.display.context.DDMFormAdminDisplayContext.java

License:Open Source License

public boolean isShowPermissionsIcon(DDMFormInstance formInstance) {
    return DDMFormInstancePermission.contains(formAdminRequestHelper.getPermissionChecker(), formInstance,
            ActionKeys.PERMISSIONS);
}

From source file:com.liferay.journal.web.internal.portlet.action.JournalPermissionAssetEntryAction.java

License:Open Source License

@Override
public boolean hasPermission(PermissionChecker permissionChecker, AssetRenderer assetRenderer)
        throws PortalException {

    JournalArticle article = (JournalArticle) assetRenderer.getAssetObject();

    return JournalArticlePermission.contains(permissionChecker, article, ActionKeys.PERMISSIONS);
}

From source file:com.liferay.journal.web.internal.portlet.configuration.icon.FeedsPermissionsPortletConfigurationIcon.java

License:Open Source License

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

    return JournalPermission.contains(themeDisplay.getPermissionChecker(), themeDisplay.getScopeGroupId(),
            ActionKeys.PERMISSIONS);
}

From source file:com.liferay.journal.web.internal.portlet.configuration.icon.PermissionsPortletConfigurationIcon.java

License:Open Source License

@Override
public boolean isShow(PortletRequest portletRequest) {
    try {//  w w  w . j  a  v  a  2  s  .c  o m
        JournalArticle article = ActionUtil.getArticle(portletRequest);

        if ((article == null) || article.isNew()) {
            return false;
        }

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

        if (JournalArticlePermission.contains(themeDisplay.getPermissionChecker(), article,
                ActionKeys.PERMISSIONS)) {

            return true;
        }
    } catch (Exception e) {
    }

    return false;
}

From source file:com.liferay.layout.admin.web.internal.display.context.LayoutsAdminDisplayContext.java

License:Open Source License

public boolean showPermissionsAction(Layout layout) throws PortalException {
    if (StagingUtil.isIncomplete(layout)) {
        return false;
    }/*from w  ww  .  ja  v a  2 s .  c  o  m*/

    Group selGroup = getSelGroup();

    if (selGroup.isLayoutPrototype()) {
        return false;
    }

    return LayoutPermissionUtil.contains(_themeDisplay.getPermissionChecker(), layout, ActionKeys.PERMISSIONS);
}

From source file:com.liferay.message.boards.internal.upgrade.v1_0_1.UpgradeUnsupportedGuestPermissions.java

License:Open Source License

@Override
public void upgrade(DBProcessContext dbProcessContext) throws UpgradeException {

    _removeResourceActions(MBCategory.class.getName(), ActionKeys.DELETE);
    _removeResourceActions(MBCategory.class.getName(), ActionKeys.MOVE_THREAD);
    _removeResourceActions(MBCategory.class.getName(), ActionKeys.PERMISSIONS);

    _removeResourceActions(MBMessage.class.getName(), ActionKeys.DELETE);
    _removeResourceActions(MBMessage.class.getName(), ActionKeys.PERMISSIONS);

    _removeResourceActions(MBPermission.RESOURCE_NAME, ActionKeys.LOCK_THREAD);
    _removeResourceActions(MBPermission.RESOURCE_NAME, ActionKeys.MOVE_THREAD);

    _removeResourceActions(MBThread.class.getName(), ActionKeys.DELETE);
}

From source file:com.liferay.message.boards.web.internal.portlet.configuration.icon.CategoryPermissionsPortletConfigurationIcon.java

License:Open Source License

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

    User user = themeDisplay.getUser();/*from w  w w .j  a va  2  s.c  o m*/

    if (user.isDefaultUser()) {
        return false;
    }

    PermissionChecker permissionChecker = themeDisplay.getPermissionChecker();

    try {
        MBCategory category = ActionUtil.getCategory(portletRequest);

        if (!MBCategoryPermission.contains(permissionChecker, category, ActionKeys.PERMISSIONS)) {

            return false;
        }
    } catch (Exception e) {
        return false;
    }

    return true;
}

From source file:com.liferay.message.boards.web.internal.portlet.configuration.icon.PermissionsPortletConfigurationIcon.java

License:Open Source License

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

    User user = themeDisplay.getUser();/*  ww  w  . j  av a 2  s  .  co m*/

    if (user.isDefaultUser()) {
        return false;
    }

    PermissionChecker permissionChecker = themeDisplay.getPermissionChecker();

    if (!MBPermission.contains(permissionChecker, themeDisplay.getScopeGroupId(), ActionKeys.PERMISSIONS)) {

        return false;
    }

    return true;
}

From source file:com.liferay.message.boards.web.internal.portlet.configuration.icon.ThreadPermissionsPortletConfigurationIcon.java

License:Open Source License

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

    User user = themeDisplay.getUser();/*w ww  . j a v  a 2  s . c om*/

    if (user.isDefaultUser()) {
        return false;
    }

    PermissionChecker permissionChecker = themeDisplay.getPermissionChecker();

    try {
        MBMessage message = ActionUtil.getMessage(portletRequest);

        MBThread thread = message.getThread();

        if (thread.isLocked()) {
            return false;
        }

        if (!MBMessagePermission.contains(permissionChecker, message, ActionKeys.PERMISSIONS)) {

            return false;
        }
    } catch (Exception e) {
        return false;
    }

    return true;
}

From source file:com.liferay.password.policies.admin.web.internal.portlet.configuration.icon.PermissionsPortletConfigurationIcon.java

License:Open Source License

@Override
public boolean isShow(PortletRequest portletRequest) {
    try {//w  ww  .  j a v a2s  .c om
        ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

        if (PasswordPolicyPermissionUtil.contains(themeDisplay.getPermissionChecker(),
                _getPasswordPolicyId(portletRequest), ActionKeys.PERMISSIONS)) {

            return true;
        }
    } catch (Exception e) {
    }

    return false;
}