001
014
015 package com.liferay.portal.convert;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.service.RoleLocalServiceUtil;
020 import com.liferay.portal.util.PropsValues;
021
022
025 public class ConvertPermissionTuner extends ConvertProcess {
026
027 public String getDescription() {
028 return "fine-tune-generated-roles";
029 }
030
031 public String getPath() {
032 return "/admin_server/edit_permissions";
033 }
034
035 public boolean isEnabled() {
036 boolean enabled = false;
037
038 try {
039 if (PropsValues.PERMISSIONS_USER_CHECK_ALGORITHM == 6) {
040 int count = RoleLocalServiceUtil.getSubtypeRolesCount(
041 "lfr-permission-algorithm-5");
042
043 if (count > 0) {
044 enabled = true;
045 }
046 }
047 }
048 catch (Exception e) {
049 _log.error(e, e);
050 }
051
052 return enabled;
053 }
054
055 protected void doConvert() throws Exception {
056 }
057
058 private static Log _log = LogFactoryUtil.getLog(
059 ConvertPermissionTuner.class);
060
061 }