1
14
15 package com.liferay.portal.service.impl;
16
17 import com.liferay.portal.kernel.exception.PortalException;
18 import com.liferay.portal.kernel.exception.SystemException;
19 import com.liferay.portal.model.PluginSetting;
20 import com.liferay.portal.model.RoleConstants;
21 import com.liferay.portal.security.auth.PrincipalException;
22 import com.liferay.portal.service.base.PluginSettingServiceBaseImpl;
23
24
29 public class PluginSettingServiceImpl extends PluginSettingServiceBaseImpl {
30
31 public PluginSetting updatePluginSetting(
32 long companyId, String pluginId, String pluginType, String roles,
33 boolean active)
34 throws PortalException, SystemException {
35
36 if (!roleLocalService.hasUserRole(
37 getUserId(), companyId, RoleConstants.ADMINISTRATOR, true)) {
38
39 throw new PrincipalException();
40 }
41
42 return pluginSettingLocalService.updatePluginSetting(
43 companyId, pluginId, pluginType, roles, active);
44 }
45
46 }