You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A user with just createRecord rights cannot create edges #830
ArcadeDB Version: ArcadeDB Server v23.1.2-SNAPSHOT (build 213e72b/1674852682016/main)
JDK Version: openjdk 11.0.16 2022-07-19
OS: debian11
Expected behavior
A user with specified createRecord and without updateRecord rights in the security groups should be able to create edges such as CREATE EDGE edge FROM #76:3 TO #112:438273 IF NOT EXISTS.
Actual behavior
The attempt to create an edge with such a user returns edge @rid , but the edge is not created. Likely, the reason is that creating an edge requires internally an update of @in/@out in the ending vertex and this user does not have the rights to update. I would like to have this feature, but I don't have a complete picture what is behind the security design decisions. At least, some exception should be returned.
Your guess was correct, once the edge is created, the vertices are updated with the reference, so technically you need the create permission on the Edge type and create+update on vertices.
Security acts at a low level, on buckets, so my fear is that if I create exceptions, I'd introduce some security hole in there.
NOTE: creating an edge is technically 2 operations: (1) create a new edge record and (2) update the vertices with the reference. For this reason, if you want to allow a user to create edges, you have to grant the createRecord permission on the edge type and updateRecord on the vertex type.
I use user with createRecord on whole database ('*').
Yes, it was my feeling that the code is not ready to create edge using just
createRecord, but you need update permissions on the vertexes.
The motivation to use an user just with createRecord permissions is to
protect database data to be removed or corrupted with update permissions
for this kind of user.
I will need to re-think my database schema.
Michael
You could limit the update only to the vertex types. I know it's not a perfect solution for your use case, but at least the scope of the update would be limited.
Activity
lvca commentedon Feb 3, 2023
What's the exception that is returned?
mik1234mc commentedon Feb 4, 2023
For instance, this command:
Returns:
However, the edge is not added to the DB; there is no record with
@rid:#166:32.lvca commentedon Feb 9, 2023
@mik1234mc does the user have
createRecordpermission on the whole database or the edge type?lvca commentedon Feb 9, 2023
I was able to reproduce it with a new test case:
Your guess was correct, once the edge is created, the vertices are updated with the reference, so technically you need the
createpermission on the Edge type andcreate+updateon vertices.Security acts at a low level, on buckets, so my fear is that if I create exceptions, I'd introduce some security hole in there.
lvca commentedon Feb 9, 2023
Just added this note in the docs:
NOTE: creating an edge is technically 2 operations: (1) create a new edge record and (2) update the vertices with the reference. For this reason, if you want to allow a user to create edges, you have to grant the
createRecordpermission on the edge type andupdateRecordon the vertex type.Added a note on security chapter about creating edges required permis…
mik1234mc commentedon Feb 9, 2023
lvca commentedon Feb 9, 2023
You could limit the update only to the vertex types. I know it's not a perfect solution for your use case, but at least the scope of the update would be limited.
test: added test case for newEdge
chore(deps): bump org.apache.maven.plugins:maven-surefire-plugin from…
chore(deps): bump org.apache.maven.plugins:maven-failsafe-plugin from…
test: added test case for newEdge
chore(deps): bump org.apache.maven.plugins:maven-surefire-plugin from…
chore(deps): bump org.apache.maven.plugins:maven-failsafe-plugin from…