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
4fc61ac4
Verified
Commit
4fc61ac4
authored
4 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
remove unnecessary changes
parent
0300902d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!21
Release v0.4.0
,
!7
F fsm
,
!6
Draft: F acm permissions2
Pipeline
#5938
passed
4 years ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/caosdb/server/entity/UpdateEntity.java
+0
-18
0 additions, 18 deletions
src/main/java/org/caosdb/server/entity/UpdateEntity.java
src/main/java/org/caosdb/server/transaction/WriteTransaction.java
+7
-13
7 additions, 13 deletions
.../java/org/caosdb/server/transaction/WriteTransaction.java
with
7 additions
and
31 deletions
src/main/java/org/caosdb/server/entity/UpdateEntity.java
+
0
−
18
View file @
4fc61ac4
...
...
@@ -22,21 +22,11 @@
*/
package
org.caosdb.server.entity
;
import
org.caosdb.server.transaction.WriteTransaction
;
import
org.caosdb.server.utils.EntityStatus
;
import
org.jdom2.Element
;
/**
* UpdateEntity class represents entities which are to be updated. The previous version is appeded
* during the {@link WriteTransaction} transactions initialization.
*
* @author Timm Fitschen <t.fitschen@indiscale.com>
*/
public
class
UpdateEntity
extends
WritableEntity
{
/** The previous version of this entity. */
private
EntityInterface
original
=
null
;
public
UpdateEntity
(
final
Element
element
)
{
super
(
element
);
}
...
...
@@ -45,12 +35,4 @@ public class UpdateEntity extends WritableEntity {
public
boolean
skipJob
()
{
return
getEntityStatus
()
!=
EntityStatus
.
QUALIFIED
;
}
public
void
setOriginal
(
EntityInterface
original
)
{
this
.
original
=
original
;
}
public
EntityInterface
getOriginal
()
{
return
this
.
original
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/org/caosdb/server/transaction/WriteTransaction.java
+
7
−
13
View file @
4fc61ac4
...
...
@@ -215,7 +215,13 @@ public class WriteTransaction extends Transaction<WritableContainer>
.
setFile
(
oldEntity
.
getFileProperties
().
retrieveFromFileSystem
());
}
((
UpdateEntity
)
entity
).
setOriginal
(
oldEntity
);
try
{
checkPermissions
(
entity
,
deriveUpdate
(
entity
,
oldEntity
));
}
catch
(
final
AuthorizationException
exc
)
{
entity
.
setEntityStatus
(
EntityStatus
.
UNQUALIFIED
);
entity
.
addError
(
ServerMessages
.
AUTHORIZATION_ERROR
);
entity
.
addInfo
(
exc
.
getMessage
());
}
}
break
innerLoop
;
}
...
...
@@ -284,18 +290,6 @@ public class WriteTransaction extends Transaction<WritableContainer>
@Override
protected
void
preCheck
()
throws
InterruptedException
,
Exception
{
for
(
final
EntityInterface
entity
:
getContainer
())
{
try
{
if
(
entity
.
getEntityStatus
()
==
EntityStatus
.
QUALIFIED
)
{
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
if
(
entity
.
getEntityACL
()
==
null
)
{
entity
.
setEntityACL
(
EntityACL
.
getOwnerACLFor
(
SecurityUtils
.
getSubject
()));
...
...
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