001
014
015 package com.liferay.portal.service.impl;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.exception.SystemException;
019 import com.liferay.portal.model.LayoutBranch;
020 import com.liferay.portal.security.permission.ActionKeys;
021 import com.liferay.portal.service.ServiceContext;
022 import com.liferay.portal.service.base.LayoutBranchServiceBaseImpl;
023 import com.liferay.portal.service.permission.GroupPermissionUtil;
024 import com.liferay.portal.service.permission.LayoutBranchPermissionUtil;
025
026
030 public class LayoutBranchServiceImpl extends LayoutBranchServiceBaseImpl {
031
032 @Override
033 public LayoutBranch addLayoutBranch(
034 long layoutRevisionId, String name, String description,
035 boolean master, ServiceContext serviceContext)
036 throws PortalException, SystemException {
037
038 long groupId = serviceContext.getScopeGroupId();
039
040 GroupPermissionUtil.check(
041 getPermissionChecker(), groupId, ActionKeys.ADD_LAYOUT_BRANCH);
042
043 return layoutBranchLocalService.addLayoutBranch(
044 layoutRevisionId, name, description, false, serviceContext);
045 }
046
047 @Override
048 public void deleteLayoutBranch(long layoutBranchId)
049 throws PortalException, SystemException {
050
051 LayoutBranchPermissionUtil.check(
052 getPermissionChecker(), layoutBranchId, ActionKeys.DELETE);
053
054 layoutBranchLocalService.deleteLayoutBranch(layoutBranchId);
055 }
056
057 @Override
058 public LayoutBranch updateLayoutBranch(
059 long layoutBranchId, String name, String description,
060 ServiceContext serviceContext)
061 throws PortalException, SystemException {
062
063 LayoutBranchPermissionUtil.check(
064 getPermissionChecker(), layoutBranchId, ActionKeys.UPDATE);
065
066 return layoutBranchLocalService.updateLayoutBranch(
067 layoutBranchId, name, description, serviceContext);
068 }
069
070 }