Add fine grained sm/ds type permission (#2649)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-09-04 15:05:32 +03:00
committed by GitHub
parent 2e97d67489
commit 2c995b3665
17 changed files with 139 additions and 74 deletions

View File

@@ -41,7 +41,7 @@ public interface DistributionSetTypeManagement<T extends DistributionSetType>
@Override
default String permissionGroup() {
return SpPermission.DISTRIBUTION_SET;
return SpPermission.DISTRIBUTION_SET_TYPE;
}
@PreAuthorize(SpringEvalExpressions.HAS_READ_REPOSITORY)

View File

@@ -35,7 +35,7 @@ public interface SoftwareModuleTypeManagement<T extends SoftwareModuleType>
@Override
default String permissionGroup() {
return SpPermission.SOFTWARE_MODULE;
return SpPermission.SOFTWARE_MODULE_TYPE;
}
/**

View File

@@ -46,19 +46,17 @@ public interface SystemManagement {
Page<String> findTenants(@NotNull Pageable pageable);
/**
* Runs consumer for each teant as
* Runs consumer for each tenant as
* {@link TenantAware#runAsTenant(String, org.eclipse.hawkbit.tenancy.TenantAware.TenantRunner)}
* sliently (i.e. exceptions will be logged but operations will continue for
* further tenants).
* silently (i.e. exceptions will be logged but operations will continue for further tenants).
*
* @param consumer to run as teanant
* @param consumer to run as tenant
*/
@PreAuthorize(SpringEvalExpressions.IS_SYSTEM_CODE)
void forEachTenant(Consumer<String> consumer);
/**
* Calculated system usage statistics, both overall for the entire system
* and per tenant;
* Calculated system usage statistics, both overall for the entire system and per tenant;
*
* @return SystemUsageReport of the current system
*/

View File

@@ -61,7 +61,7 @@ public interface Target extends NamedEntity, Identifiable<Long> {
/**
* @return the securityToken if the current security context contains the necessary permission
* {@link org.eclipse.hawkbit.im.authentication.SpPermission#READ_TARGET_SEC_TOKEN}
* {@link org.eclipse.hawkbit.im.authentication.SpPermission#READ_TARGET_SECURITY_TOKEN}
* or the current context is executed as system code, otherwise {@code null}.
*/
String getSecurityToken();