Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-server
Commits
e326435d
Verified
Commit
e326435d
authored
4 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
fix tests
parent
b92ef8d3
Branches
Branches containing commit
Tags
Tags containing commit
3 merge requests
!21
Release v0.4.0
,
!7
F fsm
,
!6
Draft: F acm permissions2
Pipeline
#5873
failed
4 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/caosdb/server/transaction/WriteTransaction.java
+26
-7
26 additions, 7 deletions
.../java/org/caosdb/server/transaction/WriteTransaction.java
with
26 additions
and
7 deletions
src/main/java/org/caosdb/server/transaction/WriteTransaction.java
+
26
−
7
View file @
e326435d
...
@@ -215,13 +215,7 @@ public class WriteTransaction extends Transaction<WritableContainer>
...
@@ -215,13 +215,7 @@ public class WriteTransaction extends Transaction<WritableContainer>
.
setFile
(
oldEntity
.
getFileProperties
().
retrieveFromFileSystem
());
.
setFile
(
oldEntity
.
getFileProperties
().
retrieveFromFileSystem
());
}
}
try
{
((
UpdateEntity
)
entity
).
setOriginal
(
oldEntity
);
checkPermissions
(
entity
,
deriveUpdate
(
entity
,
oldEntity
));
}
catch
(
final
AuthorizationException
exc
)
{
entity
.
setEntityStatus
(
EntityStatus
.
UNQUALIFIED
);
entity
.
addError
(
ServerMessages
.
AUTHORIZATION_ERROR
);
entity
.
addInfo
(
exc
.
getMessage
());
}
}
}
break
innerLoop
;
break
innerLoop
;
}
}
...
@@ -290,6 +284,16 @@ public class WriteTransaction extends Transaction<WritableContainer>
...
@@ -290,6 +284,16 @@ public class WriteTransaction extends Transaction<WritableContainer>
@Override
@Override
protected
void
preCheck
()
throws
InterruptedException
,
Exception
{
protected
void
preCheck
()
throws
InterruptedException
,
Exception
{
for
(
final
EntityInterface
entity
:
getContainer
())
{
for
(
final
EntityInterface
entity
:
getContainer
())
{
try
{
checkPermissions
(
entity
,
deriveUpdate
(
entity
,
((
UpdateEntity
)
entity
).
getOriginal
()));
}
catch
(
final
AuthorizationException
exc
)
{
entity
.
setEntityStatus
(
EntityStatus
.
UNQUALIFIED
);
entity
.
addError
(
ServerMessages
.
AUTHORIZATION_ERROR
);
entity
.
addInfo
(
exc
.
getMessage
());
}
catch
(
ClassCastException
exc
)
{
// not an update entity. ignore.
}
// set default EntityACL if none present
// set default EntityACL if none present
if
(
entity
.
getEntityACL
()
==
null
)
{
if
(
entity
.
getEntityACL
()
==
null
)
{
entity
.
setEntityACL
(
EntityACL
.
getOwnerACLFor
(
SecurityUtils
.
getSubject
()));
entity
.
setEntityACL
(
EntityACL
.
getOwnerACLFor
(
SecurityUtils
.
getSubject
()));
...
@@ -373,6 +377,21 @@ public class WriteTransaction extends Transaction<WritableContainer>
...
@@ -373,6 +377,21 @@ public class WriteTransaction extends Transaction<WritableContainer>
newEntity
.
setEntityACL
(
oldEntity
.
getEntityACL
());
newEntity
.
setEntityACL
(
oldEntity
.
getEntityACL
());
}
}
// new acl?
if
(
newEntity
.
hasEntityACL
()
&&
!
newEntity
.
getEntityACL
().
equals
(
oldEntity
.
getEntityACL
()))
{
oldEntity
.
checkPermission
(
EntityPermission
.
EDIT_ACL
);
if
(!
newEntity
.
getEntityACL
()
.
getPriorityEntityACL
()
.
equals
(
oldEntity
.
getEntityACL
().
getPriorityEntityACL
()))
{
// priority acl is to be changed?
oldEntity
.
checkPermission
(
Permission
.
EDIT_PRIORITY_ACL
);
}
updatetable
=
true
;
}
else
if
(!
newEntity
.
hasEntityACL
())
{
newEntity
.
setEntityACL
(
oldEntity
.
getEntityACL
());
}
// new query template definition?
// new query template definition?
if
(!
Objects
.
equals
(
if
(!
Objects
.
equals
(
newEntity
.
getQueryTemplateDefinition
(),
oldEntity
.
getQueryTemplateDefinition
()))
{
newEntity
.
getQueryTemplateDefinition
(),
oldEntity
.
getQueryTemplateDefinition
()))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment