changed export-xml-permission for an invited user in a description template
This commit is contained in:
parent
1bacd7fc4a
commit
42a1fbf691
|
@ -167,7 +167,7 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
|
|||
Boolean isUpdate = this.conventionService.isValidGuid(model.getId());
|
||||
if (isUpdate) this.authorizationService.authorizeAtLeastOneForce(List.of(this.authorizationContentResolver.descriptionTemplateAffiliation(model.getId())), Permission.EditDescriptionTemplate);
|
||||
else this.authorizationService.authorizeForce(Permission.EditDescriptionTemplate);
|
||||
|
||||
|
||||
DescriptionTemplateEntity data;
|
||||
if (isUpdate) {
|
||||
data = this.entityManager.find(DescriptionTemplateEntity.class, model.getId());
|
||||
|
@ -869,7 +869,7 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
|
|||
public DescriptionTemplateImportExport exportXmlEntity(UUID id, boolean ignoreAuthorize) throws MyForbiddenException, MyNotFoundException, JAXBException, ParserConfigurationException, IOException, InstantiationException, IllegalAccessException, SAXException {
|
||||
logger.debug(new MapLogEntry("exportXml").And("id", id));
|
||||
|
||||
if (!ignoreAuthorize) this.authorizationService.authorizeForce(Permission.ExportDescriptionTemplate);
|
||||
if (!ignoreAuthorize) this.authorizationService.authorizeAtLeastOneForce(List.of(this.authorizationContentResolver.descriptionTemplateAffiliation(id)), Permission.ExportDescriptionTemplate);
|
||||
DescriptionTemplateEntity data = this.queryFactory.query(DescriptionTemplateQuery.class).disableTracking().ids(id).authorize(AuthorizationFlags.AllExceptPublic).first();
|
||||
if (data == null) throw new MyNotFoundException(this.messageSource.getMessage("General_ItemNotFound", new Object[]{id, DescriptionTemplate.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
||||
|
||||
|
@ -882,7 +882,8 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
|
|||
public ResponseEntity<byte[]> exportXml(UUID id) throws MyForbiddenException, MyNotFoundException, JAXBException, ParserConfigurationException, IOException, InstantiationException, IllegalAccessException, SAXException, InvalidApplicationException {
|
||||
logger.debug(new MapLogEntry("exportXml").And("id", id));
|
||||
|
||||
this.authorizationService.authorizeForce(Permission.ExportDescriptionTemplate);
|
||||
this.authorizationService.authorizeAtLeastOneForce(List.of(this.authorizationContentResolver.descriptionTemplateAffiliation(id)), Permission.ExportDescriptionTemplate);
|
||||
|
||||
DescriptionTemplateEntity data = this.queryFactory.query(DescriptionTemplateQuery.class).disableTracking().ids(id).authorize(AuthorizationFlags.AllExceptPublic).first();
|
||||
if (data == null) throw new MyNotFoundException(this.messageSource.getMessage("General_ItemNotFound", new Object[]{id, DescriptionTemplate.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
||||
|
||||
|
|
|
@ -468,6 +468,9 @@ permissions:
|
|||
- Admin
|
||||
- TenantAdmin
|
||||
- TenantPlanManager
|
||||
descriptionTemplate:
|
||||
roles:
|
||||
- Owner
|
||||
claims: [ ]
|
||||
clients: [ ]
|
||||
allowAnonymous: false
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div class="col">
|
||||
<app-navigation-breadcrumb />
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="col-auto" *ngIf="canCreateNew()">
|
||||
<button mat-raised-button class="import-btn" (click)="import()">
|
||||
<span class="button-text">
|
||||
{{'DESCRIPTION-TEMPLATE-LISTING.IMPORT.UPLOAD-XML' | translate}}
|
||||
|
|
|
@ -202,8 +202,12 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent<De
|
|||
return descriptionTemplate.status !== DescriptionTemplateStatus.Finalized && this.hasPermission(AppPermission.EditDescriptionTemplate, descriptionTemplate);
|
||||
}
|
||||
|
||||
public canCreateNew(): boolean {
|
||||
return this.hasExplicitPermission(AppPermission.EditDescriptionTemplate);
|
||||
}
|
||||
|
||||
public canAddNewVersion(descriptionTemplate: DescriptionTemplate): boolean {
|
||||
return descriptionTemplate.belongsToCurrentTenant != false && this.hasExplicitPermission(AppPermission.EditDescriptionTemplate);
|
||||
return descriptionTemplate.belongsToCurrentTenant != false && this.canCreateNew();
|
||||
}
|
||||
|
||||
public canClone(descriptionTemplate: DescriptionTemplate): boolean {
|
||||
|
@ -211,11 +215,11 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent<De
|
|||
}
|
||||
|
||||
public canViewVersions(descriptionTemplate: DescriptionTemplate): boolean {
|
||||
return descriptionTemplate.belongsToCurrentTenant != false && this.hasExplicitPermission(AppPermission.EditDescriptionTemplate);
|
||||
return descriptionTemplate.belongsToCurrentTenant != false && this.canCreateNew();
|
||||
}
|
||||
|
||||
public canDownloadXml(descriptionTemplate: DescriptionTemplate): boolean {
|
||||
return descriptionTemplate.belongsToCurrentTenant != false && this.hasPermission(AppPermission.ExportDescriptionTemplate, descriptionTemplate);
|
||||
return descriptionTemplate.belongsToCurrentTenant != false;
|
||||
}
|
||||
|
||||
public canDelete(descriptionTemplate: DescriptionTemplate): boolean {
|
||||
|
|
Loading…
Reference in New Issue