|
|
|
@ -61,7 +61,7 @@ public class WidgetsBundleController extends BaseController { |
|
|
|
@ResponseBody |
|
|
|
public WidgetsBundle saveWidgetsBundle(@RequestBody WidgetsBundle widgetsBundle) throws ThingsboardException { |
|
|
|
try { |
|
|
|
if (getCurrentUser().getAuthority() == Authority.SYS_ADMIN) { |
|
|
|
if (Authority.SYS_ADMIN.equals(getCurrentUser().getAuthority())) { |
|
|
|
widgetsBundle.setTenantId(TenantId.SYS_TENANT_ID); |
|
|
|
} else { |
|
|
|
widgetsBundle.setTenantId(getCurrentUser().getTenantId()); |
|
|
|
@ -103,7 +103,7 @@ public class WidgetsBundleController extends BaseController { |
|
|
|
@RequestParam(required = false) String sortOrder) throws ThingsboardException { |
|
|
|
try { |
|
|
|
PageLink pageLink = createPageLink(pageSize, page, textSearch, sortProperty, sortOrder); |
|
|
|
if (getCurrentUser().getAuthority() == Authority.SYS_ADMIN) { |
|
|
|
if (Authority.SYS_ADMIN.equals(getCurrentUser().getAuthority())) { |
|
|
|
return checkNotNull(widgetsBundleService.findSystemWidgetsBundlesByPageLink(getTenantId(), pageLink)); |
|
|
|
} else { |
|
|
|
TenantId tenantId = getCurrentUser().getTenantId(); |
|
|
|
@ -119,7 +119,7 @@ public class WidgetsBundleController extends BaseController { |
|
|
|
@ResponseBody |
|
|
|
public List<WidgetsBundle> getWidgetsBundles() throws ThingsboardException { |
|
|
|
try { |
|
|
|
if (getCurrentUser().getAuthority() == Authority.SYS_ADMIN) { |
|
|
|
if (Authority.SYS_ADMIN.equals(getCurrentUser().getAuthority())) { |
|
|
|
return checkNotNull(widgetsBundleService.findSystemWidgetsBundles(getTenantId())); |
|
|
|
} else { |
|
|
|
TenantId tenantId = getCurrentUser().getTenantId(); |
|
|
|
|