mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fix unmodifiable list referencing issue
This commit is contained in:
parent
947c174808
commit
30f7a32c55
@ -184,7 +184,7 @@ public class APIPublisherServiceImpl implements APIPublisherService {
|
|||||||
scope.setDisplayName(apiScope.getName());
|
scope.setDisplayName(apiScope.getName());
|
||||||
scope.setDescription(apiScope.getDescription());
|
scope.setDescription(apiScope.getDescription());
|
||||||
scope.setName(apiScope.getKey());
|
scope.setName(apiScope.getKey());
|
||||||
List<String> bindings = apiScope.getRoles();
|
List<String> bindings = new ArrayList<>(apiScope.getRoles());
|
||||||
bindings.add(ADMIN_ROLE_KEY);
|
bindings.add(ADMIN_ROLE_KEY);
|
||||||
scope.setBindings(bindings);
|
scope.setBindings(bindings);
|
||||||
publisherRESTAPIServices.addNewSharedScope(apiApplicationKey, accessTokenInfo, scope);
|
publisherRESTAPIServices.addNewSharedScope(apiApplicationKey, accessTokenInfo, scope);
|
||||||
@ -259,7 +259,7 @@ public class APIPublisherServiceImpl implements APIPublisherService {
|
|||||||
scope.setName(apiScope.getKey());
|
scope.setName(apiScope.getKey());
|
||||||
scope.setDescription(apiScope.getDescription());
|
scope.setDescription(apiScope.getDescription());
|
||||||
scope.setDisplayName(apiScope.getName());
|
scope.setDisplayName(apiScope.getName());
|
||||||
List<String> bindings = apiScope.getRoles();
|
List<String> bindings = new ArrayList<>(apiScope.getRoles());
|
||||||
bindings.add(ADMIN_ROLE_KEY);
|
bindings.add(ADMIN_ROLE_KEY);
|
||||||
scope.setBindings(bindings);
|
scope.setBindings(bindings);
|
||||||
publisherRESTAPIServices.addNewSharedScope(apiApplicationKey, accessTokenInfo, scope);
|
publisherRESTAPIServices.addNewSharedScope(apiApplicationKey, accessTokenInfo, scope);
|
||||||
@ -282,7 +282,7 @@ public class APIPublisherServiceImpl implements APIPublisherService {
|
|||||||
scope.setName(apiScope.getKey());
|
scope.setName(apiScope.getKey());
|
||||||
scope.setDescription(apiScope.getDescription());
|
scope.setDescription(apiScope.getDescription());
|
||||||
scope.setDisplayName(apiScope.getName());
|
scope.setDisplayName(apiScope.getName());
|
||||||
List<String> bindings = apiScope.getRoles();
|
List<String> bindings = new ArrayList<>(apiScope.getRoles());
|
||||||
bindings.add(ADMIN_ROLE_KEY);
|
bindings.add(ADMIN_ROLE_KEY);
|
||||||
scope.setBindings(bindings);
|
scope.setBindings(bindings);
|
||||||
publisherRESTAPIServices.addNewSharedScope(apiApplicationKey, accessTokenInfo, scope);
|
publisherRESTAPIServices.addNewSharedScope(apiApplicationKey, accessTokenInfo, scope);
|
||||||
@ -459,10 +459,8 @@ public class APIPublisherServiceImpl implements APIPublisherService {
|
|||||||
//todo check whether scope is available or not
|
//todo check whether scope is available or not
|
||||||
ScopeMapping scopeMapping = defaultPermission.getScopeMapping();
|
ScopeMapping scopeMapping = defaultPermission.getScopeMapping();
|
||||||
|
|
||||||
String[] roles = scopeMapping.getDefaultRoles().split(",");
|
List<String> bindings = new ArrayList<>(
|
||||||
List<String> bindings = Arrays.asList(roles);
|
Arrays.asList(scopeMapping.getDefaultRoles().split(",")));
|
||||||
bindings.add(ADMIN_ROLE_KEY);
|
|
||||||
|
|
||||||
scope.setName(scopeMapping.getKey());
|
scope.setName(scopeMapping.getKey());
|
||||||
scope.setDescription(scopeMapping.getName());
|
scope.setDescription(scopeMapping.getName());
|
||||||
scope.setDisplayName(scopeMapping.getName());
|
scope.setDisplayName(scopeMapping.getName());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user