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 public LayoutBranch addLayoutBranch(
033 long layoutRevisionId, String name, String description,
034 boolean master, ServiceContext serviceContext)
035 throws PortalException, SystemException {
036
037 long groupId = serviceContext.getScopeGroupId();
038
039 GroupPermissionUtil.check(
040 getPermissionChecker(), groupId, ActionKeys.ADD_LAYOUT_BRANCH);
041
042 return layoutBranchLocalService.addLayoutBranch(
043 layoutRevisionId, name, description, false, serviceContext);
044 }
045
046 public void deleteLayoutBranch(long layoutBranchId)
047 throws PortalException, SystemException {
048
049 LayoutBranchPermissionUtil.check(
050 getPermissionChecker(), layoutBranchId, ActionKeys.DELETE);
051
052 layoutBranchLocalService.deleteLayoutBranch(layoutBranchId);
053 }
054
055 public LayoutBranch updateLayoutBranch(
056 long layoutBranchId, String name, String description,
057 ServiceContext serviceContext)
058 throws PortalException, SystemException {
059
060 LayoutBranchPermissionUtil.check(
061 getPermissionChecker(), layoutBranchId, ActionKeys.UPDATE);
062
063 return layoutBranchLocalService.updateLayoutBranch(
064 layoutBranchId, name, description, serviceContext);
065 }
066
067 }