|
|
|
@ -456,7 +456,8 @@ public class APIPublisherServiceImpl implements APIPublisherService {
|
|
|
|
|
|
|
|
|
|
Scope scope = new Scope();
|
|
|
|
|
for (DefaultPermission defaultPermission: defaultPermissions.getDefaultPermissions()) {
|
|
|
|
|
//todo check whether scope is available or not
|
|
|
|
|
if (!publisherRESTAPIServices.isSharedScopeNameExists(apiApplicationKey, accessTokenInfo,
|
|
|
|
|
defaultPermission.getScopeMapping().getKey())) {
|
|
|
|
|
ScopeMapping scopeMapping = defaultPermission.getScopeMapping();
|
|
|
|
|
|
|
|
|
|
List<String> bindings = new ArrayList<>(
|
|
|
|
@ -468,6 +469,7 @@ public class APIPublisherServiceImpl implements APIPublisherService {
|
|
|
|
|
scope.setBindings(bindings);
|
|
|
|
|
publisherRESTAPIServices.addNewSharedScope(apiApplicationKey, accessTokenInfo, scope);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (BadRequestException | UnexpectedResponseException | APIServicesException e) {
|
|
|
|
|
log.error("Error occurred while adding default scopes");
|
|
|
|
|
}
|
|
|
|
|