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
031 public class LayoutBranchServiceImpl extends LayoutBranchServiceBaseImpl {
032
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 public void deleteLayoutBranch(long layoutBranchId)
048 throws PortalException, SystemException {
049
050 LayoutBranchPermissionUtil.check(
051 getPermissionChecker(), layoutBranchId, ActionKeys.DELETE);
052
053 layoutBranchLocalService.deleteLayoutBranch(layoutBranchId);
054 }
055
056 public LayoutBranch updateLayoutBranch(
057 long layoutBranchId, String name, String description,
058 ServiceContext serviceContext)
059 throws PortalException, SystemException {
060
061 LayoutBranchPermissionUtil.check(
062 getPermissionChecker(), layoutBranchId, ActionKeys.UPDATE);
063
064 return layoutBranchLocalService.updateLayoutBranch(
065 layoutBranchId, name, description, serviceContext);
066 }
067
068 }