+
-
+
\ No newline at end of file
diff --git a/src/app/project/ontology/ontology.component.ts b/src/app/project/ontology/ontology.component.ts
index 63aedf8f9f..0f0c10a4de 100644
--- a/src/app/project/ontology/ontology.component.ts
+++ b/src/app/project/ontology/ontology.component.ts
@@ -19,7 +19,8 @@ import {
PropertyDefinition,
ReadOntology,
ReadProject,
- UpdateOntology
+ UpdateOntology,
+ UserResponse
} from '@dasch-swiss/dsp-js';
import { CacheService } from 'src/app/main/cache/cache.service';
import { DspApiConnectionToken } from 'src/app/main/declarations/dsp-api-tokens';
@@ -58,9 +59,10 @@ export class OntologyComponent implements OnInit {
// permissions of logged-in user
session: Session;
- // system admin or project admin is by default false
+ // system admin, project admin, and project member are by default false
sysAdmin = false;
projectAdmin = false;
+ projectMember = false;
// project shortcode; as identifier in project cache service
projectCode: string;
@@ -194,8 +196,13 @@ export class OntologyComponent implements OnInit {
// is logged-in user projectAdmin?
this.projectAdmin = this.sysAdmin ? this.sysAdmin : this.session.user.projectAdmin.some(e => e === this.project.id);
- // get the ontologies for this project
- this.initOntologiesList();
+ this._dspApiConnection.admin.usersEndpoint.getUserByUsername(this.session.user.name).subscribe(
+ (userResponse: ApiResponseData
) => {
+ this.projectMember = userResponse.body.user.projects.some(p => p.shortcode === this.project.shortcode);
+
+ // get the ontologies for this project
+ this.initOntologiesList();
+ });
this.ontologyForm = this._fb.group({
ontology: new FormControl({
diff --git a/src/app/project/ontology/property-info/property-info.component.ts b/src/app/project/ontology/property-info/property-info.component.ts
index 7e4b59c2d1..ce137dd520 100644
--- a/src/app/project/ontology/property-info/property-info.component.ts
+++ b/src/app/project/ontology/property-info/property-info.component.ts
@@ -102,6 +102,8 @@ export class PropertyInfoComponent implements OnChanges, AfterContentInit {
@Input() lastModificationDate?: string;
+ @Input() userCanEdit: boolean; // is user a project admin or sys admin?
+
// event emitter when the lastModificationDate changed; bidirectional binding with lastModificationDate parameter
@Output() lastModificationDateChange: EventEmitter = new EventEmitter();
@@ -315,8 +317,10 @@ export class PropertyInfoComponent implements OnChanges, AfterContentInit {
* show action bubble with various CRUD buttons when hovered over.
*/
mouseEnter() {
- this.canBeDeleted();
- this.showActionBubble = true;
+ if (this.userCanEdit) {
+ this.canBeDeleted();
+ this.showActionBubble = true;
+ }
}
/**
diff --git a/src/app/project/ontology/resource-class-info/resource-class-info.component.html b/src/app/project/ontology/resource-class-info/resource-class-info.component.html
index 640d1847af..dd7eb3da54 100644
--- a/src/app/project/ontology/resource-class-info/resource-class-info.component.html
+++ b/src/app/project/ontology/resource-class-info/resource-class-info.component.html
@@ -18,7 +18,8 @@
-
+
+
+
-
-
+
Open resource instances
-
-
+
Delete resource class
@@ -56,40 +63,40 @@
-
- {{i + 1}})
-
+ {{i + 1}})
+
+
drag_indicator
-
+
-
+
- There is no property assigned to this class yet.
+ There are no properties assigned to this class yet.
-
+
add
@@ -105,9 +112,8 @@
{{type.group}}
@@ -115,10 +121,11 @@
-
+
\ No newline at end of file
diff --git a/src/app/project/ontology/resource-class-info/resource-class-info.component.spec.ts b/src/app/project/ontology/resource-class-info/resource-class-info.component.spec.ts
index 044332fdd0..2d04ef9873 100644
--- a/src/app/project/ontology/resource-class-info/resource-class-info.component.spec.ts
+++ b/src/app/project/ontology/resource-class-info/resource-class-info.component.spec.ts
@@ -30,7 +30,7 @@ import { ResourceClassInfoComponent } from './resource-class-info.component';
* Property is of type simple text
*/
@Component({
- template: ''
+ template: ''
})
class HostComponent implements OnInit {
@@ -41,6 +41,8 @@ class HostComponent implements OnInit {
resourceClass: ClassDefinition;
+ userCanEdit: boolean;
+
constructor(
private _cache: CacheService,
private _sortingService: SortingService
@@ -72,6 +74,8 @@ class HostComponent implements OnInit {
}
);
+ this.userCanEdit = true;
+
}
}
diff --git a/src/app/project/ontology/resource-class-info/resource-class-info.component.ts b/src/app/project/ontology/resource-class-info/resource-class-info.component.ts
index 69c9bf6f85..aacd84e222 100644
--- a/src/app/project/ontology/resource-class-info/resource-class-info.component.ts
+++ b/src/app/project/ontology/resource-class-info/resource-class-info.component.ts
@@ -57,6 +57,8 @@ export class ResourceClassInfoComponent implements OnInit {
@Input() lastModificationDate?: string;
+ @Input() userCanEdit: boolean; // is user a project admin or sys admin?
+
// event emitter when the lastModificationDate changed; bidirectional binding with lastModificationDate parameter
@Output() lastModificationDateChange: EventEmitter = new EventEmitter();
diff --git a/src/app/project/project.component.html b/src/app/project/project.component.html
index ad72e5ab2a..2569ba63e2 100644
--- a/src/app/project/project.component.html
+++ b/src/app/project/project.component.html
@@ -1,11 +1,11 @@