// tenantId = MultitenantUtils.getTenantId(DashboardContext.getConfigContext());
// } catch (Exception e) {
// throw new DeploymentException(e);
// }
UserRegistry registry = getRegistry(tenantID);
// Extracting archive
String extractedArchiveDir = extractGarArchive(deploymentFileData.getAbsolutePath());
// Set permission for anonymous read. We do it here because it should happen always in order
// to support mounting a remote registry.
if (registry != null) {
AuthorizationManager accessControlAdmin =
registry.getUserRealm().getAuthorizationManager();
if (!accessControlAdmin.isRoleAuthorized(CarbonConstants.REGISTRY_ANONNYMOUS_ROLE_NAME, RegistryConstants.CONFIG_REGISTRY_BASE_PATH +
REGISTRY_GADGET_STORAGE_PATH, ActionConstants.GET)) {
accessControlAdmin.authorizeRole(CarbonConstants.REGISTRY_ANONNYMOUS_ROLE_NAME, RegistryConstants.CONFIG_REGISTRY_BASE_PATH +
REGISTRY_GADGET_STORAGE_PATH, ActionConstants.GET);