Project

General

Profile

WorkshopRightsAndRoles2017-11 » History » Version 39

Andreas Kohlbecker, 12/21/2017 10:55 AM

1 1 Andreas Kohlbecker
# Workshop Rights & Roles 2017-11
2
3 6 Andreas Kohlbecker
see also #7089
4
5 5 Andreas Kohlbecker
Results of the Rights & Roles workshop held on November 27th - 30th at the BGBM.
6
7
Attendees: Andreas Kohlbecker, Katja Luther, Andreas Müller, Patrick Plitzner  
8
9
------
10 39 Andreas Kohlbecker
{{>toc}}
11 5 Andreas Kohlbecker
12 21 Andreas Kohlbecker
# Continued create problem and private entity graphs
13 1 Andreas Kohlbecker
14 10 Andreas Kohlbecker
The "*continued create*" problem exists in cases when a user only is granted to perform `CREATE` operations for a specific entity type but misses having the `UPDATE` grant. Users may need to continue to edit the newly created entity and other new parts in the connected entity graph.
15 1 Andreas Kohlbecker
16 16 Andreas Kohlbecker
In consideration of this problem we introduced the concept of directed "***private entity graphs***". *Private entity graphs* are *owned* by the creator of all entities involved. An entity is owned by the creating user as long the `createdBy`  and `updatedBy` are equal. 
17 10 Andreas Kohlbecker
  
18 1 Andreas Kohlbecker
{{thumbnail(private-entity-graphs.JPG, size=500)}}
19 10 Andreas Kohlbecker
20 31 Andreas Müller
As long as as *private entity graph* is completely disconnected from the rest of the world the case is quite simple. But it is getting more difficult once 
21 10 Andreas Kohlbecker
22
A. the graph is becoming associated to other entities which are not owned by the creator of the *private entity graph*. 
23 29 Andreas Müller
B. an entity inside this graph is being updated by another user. This changes the `updatedBy` property and this entity is no longer owned by the creator. Updated by can't be changed back to the creator as the creator does not have update rights on something he/she currently does not own.
24 10 Andreas Kohlbecker
25 31 Andreas Müller
In both cases this "***ownership***" change needs to propagate through the graph to other entities. This propagation travels along the directed edges of the graph. This directional property of the edges is expressed in the diagrams above by red arrow heads whereas the arrow head can be dashed. A dashed arrow head means that it is optional depending on the specific project requirements. An entity `A` which is connected by a directed edge with an entity `B` (`A<----B`) provides data for `B` from which `B` essentially depends. `A` cannot be changed without implicitly changing `B`. That `B` potentially ***blocks*** modifications of `A`. This blocking actually manifests when the "***owning***" user of `A` loses the exclusive ownership of `B` in turn of the two cases described above.
26 10 Andreas Kohlbecker
27 32 Andreas Müller
The blocking nature of an edge, that is of an entity class property, can be expressed in the model classes by introducing according annotations. See strategy 5).
28 8 Katja Luther
29 1 Andreas Kohlbecker
## Strategy 1 - "Publish View"
30 13 Andreas Kohlbecker
31 28 Andreas Kohlbecker
A "view" has associations to all entities which are included into the view.
32 1 Andreas Kohlbecker
33
Views potentially can replace general UPDATE & READ permissions. In this case `Users` are participants of specific views by being associated with it. 
34 28 Andreas Kohlbecker
35 33 Andreas Kohlbecker
The views strategy opens a mechanism to handle those events when a *private entity graph* is becoming connected to a non private entity which causes the graph or parts of being blocked:
36 1 Andreas Kohlbecker
37 33 Andreas Kohlbecker
{{thumbnail(strategy_1.jpg, size=500)}}
38 1 Andreas Kohlbecker
39 33 Andreas Kohlbecker
1. The *private entity graph* get associated with a non private entitiy
40
2. The  formerly entity `TypeD` is now blocked and can in principle no longer be edited by the user having only the `CREATE` authority.
41
3. depending on the project preferences the entity `TypeD` is 
42 34 Andreas Kohlbecker
    * made public automatically by asscoiating it with the 'PublishView' 
43
    * is put into the 'PublishView' manually in an editorial, curatorial process
44 32 Andreas Müller
45 37 Andreas Kohlbecker
As noted in point 2) editing of `TypeD` is only blocks in principal but can be allowed as long it is not incorporated into the 'PublishView'. So this strategy **can replace the strategy 2b)** which also allows to continue to edit blocked *private entity graphs*.
46 28 Andreas Kohlbecker
47 33 Andreas Kohlbecker
Different views can exist for published data and data in review (maybe there are more views if the project needs more states). Data which are "under constructions" can be updated by the original owner and are not visible to the public. 
48
49 13 Andreas Kohlbecker
50 14 Andreas Kohlbecker
## Strategy 2 - "Per property permissions"
51 1 Andreas Kohlbecker
52
{{thumbnail(strategy_2.jpg, size=500)}}
53 16 Andreas Kohlbecker
54 17 Andreas Kohlbecker
Grant authorities per entity class property. 
55 1 Andreas Kohlbecker
56 17 Andreas Kohlbecker
**2a)**
57
For non cdm-entity properties this allows users to edit this and only this specific field.
58 2 Andreas Kohlbecker
59 17 Andreas Kohlbecker
**2b)**
60 9 Katja Luther
61 37 Andreas Kohlbecker
For cdm-entity properties, this allows to express that a user can continue to edit an *owned* entity or *private entity graph* despite the fact that it is associated to a *non-private* entity which is connected via a "*blocking*" relation.  Without this explicit per property permission the formerly private entity and subsequently parts of the private entity graph would be blocked by creating this relation. **can be replaced by  strategy 1)**
62 13 Andreas Kohlbecker
63 17 Andreas Kohlbecker
64 13 Andreas Kohlbecker
## Strategy 3 - "Unpublished Entities - general READ rights"
65 1 Andreas Kohlbecker
66 32 Andreas Müller
**This strategy must be implemented in any case,** since general READ permissions are a requirement in multiple projects. Euro+Med is an example.
67 22 Andreas Kohlbecker
68 3 Andreas Kohlbecker
{{thumbnail(strategy_3.jpg, size=500)}}
69 13 Andreas Kohlbecker
70 17 Andreas Kohlbecker
In publication tools we need different possibilities to filter:
71 32 Andreas Müller
Filtered DTOs to provide DTOs containing only information the user has the permissions to see.
72
For the case of collections of CDM entities the user has the permission to see them and CDM entities the user has no permission to see, we need filtered collections for the service layer.
73 9 Katja Luther
74 32 Andreas Müller
The editor does not need filter but it should be possible to hide information (undisclosed entities)
75 1 Andreas Kohlbecker
76 14 Andreas Kohlbecker
## Strategy 4
77
78 32 Andreas Müller
Managing referencing objects information in the referenced CDM entity. 
79 14 Andreas Kohlbecker
80 1 Andreas Kohlbecker
{{thumbnail(strategy_4.jpg, size=500)}}
81 14 Andreas Kohlbecker
82 36 Andreas Müller
Implementing this strategy involves a model change. CDM classes will be extended by adding the below fields for each collection of CDM entities. These can either go directly into the entity class or may be implemented by introducing a separate class to hold this information. The benefit of the latter option is that updating the referencing objects information is not causing an update of the referenced entity record. In the first case it is needed to suppress auditing and changes of the `updatedBy` and `updatedWhen` fields of the referenced entity.
83 14 Andreas Kohlbecker
84 38 Andreas Müller
Explicitly managing and persisting the referencing objects information avoids excessive database querying in order to find the referencing objects via the `ICdmGenericDao.getReferencingObjects(CdmBase referencedCdmBase)` method. To determine the bounds of  *private entity graphs* it is not needed to get hold of the referencing objects, it merely is sufficient to know if there are more than one different users *owning* the referencing objects.   
85 15 Andreas Kohlbecker
86 38 Andreas Müller
* `User {collection_property_name}FirstReferencingObjectsUser`: A reference to the the user which was the one in the 'updatedBy' field of the first entity ever referencing this object.  
87 15 Andreas Kohlbecker
* `boolean {collection_property_name}IsMultiplyReferenced`: true if there are more then one referencing objects (optionally as count value?)
88
* `boolean {collection_property_name}IsReferencedByMultiplyOwnedEntities`: true if the referencing objects are "*owned*" by multiple users. (optionally as count value?) 
89 1 Andreas Kohlbecker
90
The semantics of "*owned*" in the context of this strategy refers to the user referenced in the `updatedBy` field. In case `updatedBy` is null it refers to `createdBy`. **This semantics  of *ownership* is different to that in the *private entity graphs*!**
91
92 19 Andreas Kohlbecker
**TODO**: Why is `{collection_property_name}FirstReferencingObjectsUser` needed and how can this information be updated once the according referencing entity is updated by a different user?  
93 15 Andreas Kohlbecker
94 19 Andreas Kohlbecker
## Strategy 5
95 1 Andreas Kohlbecker
96
{{thumbnail(strategy_5.jpg, size=500)}}
97 3 Andreas Kohlbecker
98 23 Andreas Kohlbecker
Introduction of two new method level java annotations by which the *blocking* nature of a property can be expresses (see above for more details on *blocking*):
99
100
* **@isBlockedBy**: Annotation for the arrow end, head, of the directed edge.
101
* **@isBlocking** : Annotation for the tail of the the directed edge.
102
103
These  annotations are being interpreted by business logic classes which implement the propagation of *blocking* events in the *private entity graphs*. This propagation can lead to an decision to 
104
105
* A. implicit deny editing of the entities in the subgraph
106
* B. withdraw previously granted per entity permissions (see strategy 6)
107
108 19 Andreas Kohlbecker
## Strategy 6
109
110 3 Andreas Kohlbecker
{{thumbnail(strategy_6.jpg, size=500)}}
111 23 Andreas Kohlbecker
112 24 Andreas Kohlbecker
Explicitly grant and withdraw per entity granted authorities as currently implemented for the phycobank registry (see #6867 & #4305) 
113 1 Andreas Kohlbecker
114
{{thumbnail(per_entity_permissions_and_groups.jpg, size=500)}}
115 24 Andreas Kohlbecker
116 38 Andreas Müller
The per entity granted authorities are either directly associated with the user or could be assigned to per user permission groups. The idea of per user permission groups is lend from unix where a group is being created by default for each user.  
117 3 Andreas Kohlbecker
118 19 Andreas Kohlbecker
## Strategy 7
119
120 1 Andreas Kohlbecker
{{thumbnail(strategy_7.jpg, size=500)}}
121
122 38 Andreas Müller
This is the concept of having an explicit workflow state information for an entity type as it is implemented for the `Registration` class. We might want to implement workflow states for each CDM type. By this is would for example become possible to create a new `Term`, use it immediately even if not yet published. The term will undergo a review process during which the decision is being made whether to publish it or not.
123 25 Andreas Kohlbecker
124
* This strategy implies strategy 5
125 38 Andreas Müller
* This strategy can be replaced by strategy 1
126 25 Andreas Kohlbecker
    
127
128 38 Andreas Müller
(BTW: The flowers are artwork painted by AMs' daughters) 
129 25 Andreas Kohlbecker
130 19 Andreas Kohlbecker
131 20 Andreas Kohlbecker
## Use Cases 
132 19 Andreas Kohlbecker
133 1 Andreas Kohlbecker
{{thumbnail(Usecases.JPG, size=500)}}
134 19 Andreas Kohlbecker
135
136
Table of use cases in which users which only `CREATE` authorities need to perform continued editing. That is these are use cases in which the *private entity graphs* are relevant which can be connected to non-private entities.  The acronym *DS* used in here refers to the term *Data Slave* which has been used as jocular term for users which only `CREATE` authorities for specific entity types. 
137
138 38 Andreas Müller
Table columns: 
139 19 Andreas Kohlbecker
140
* *no review*: The newly created entities are becoming immediately public
141 1 Andreas Kohlbecker
* *in review/reviewed*: The newly created entities are first being reviewed before becoming public. Maybe the publication is rejected by the reviewer.  
142 20 Andreas Kohlbecker
143 38 Andreas Müller
In both columns the strategies required to realize the use case are noted. Often strategies need to be combined, this is expressed by `+`, optionally strategies are in brackets `()`. `||` mean OR and expresses alternative combinations of strategies. 
144 19 Andreas Kohlbecker
145
Use cases 
146
147 38 Andreas Müller
* *DS-non-entity*: editing of a single non CDM entity property like a persistent ID, geo reference, etc. This is a special case since it does not involve the creation of a *private entity graph*.
148 26 Andreas Kohlbecker
* **TODO** ... to be continued
149 1 Andreas Kohlbecker
150 21 Andreas Kohlbecker
# Combing GrantedAuthorities
151
 
152 1 Andreas Kohlbecker
{{thumbnail(GrantedAuthorities_1.jpg, size=500)}}
153 26 Andreas Kohlbecker
154
* The class `CdmAuthority` needs to become a cdm model class which replaces, extends `GrantedAutorityImpl`.
155 3 Andreas Kohlbecker
156 18 Andreas Kohlbecker
{{thumbnail(GrantedAuthorities_2.jpg, size=500)}}