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
c33e7181
Verified
Commit
c33e7181
authored
2 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: fix
#196
parent
fa687d47
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!96
DOC: Added CITATION.cff to the list of files in the release guide where the...
,
!84
fixing server issue #196
Pipeline
#35130
passed
2 years ago
Stage: info
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/jobs/core/AccessControl.java
+11
-8
11 additions, 8 deletions
src/main/java/org/caosdb/server/jobs/core/AccessControl.java
with
11 additions
and
8 deletions
src/main/java/org/caosdb/server/jobs/core/AccessControl.java
+
11
−
8
View file @
c33e7181
...
...
@@ -28,6 +28,7 @@ import org.caosdb.server.accessControl.ACMPermissions;
import
org.caosdb.server.entity.DeleteEntity
;
import
org.caosdb.server.entity.EntityInterface
;
import
org.caosdb.server.entity.InsertEntity
;
import
org.caosdb.server.entity.Role
;
import
org.caosdb.server.entity.UpdateEntity
;
import
org.caosdb.server.jobs.ContainerJob
;
import
org.caosdb.server.jobs.JobAnnotation
;
...
...
@@ -47,12 +48,15 @@ public class AccessControl extends ContainerJob {
super
(
permission
,
description
);
}
public
final
String
toString
(
String
entityRole
)
{
return
toString
().
replace
(
ENTITY_ROLE_PARAMETER
,
entityRole
);
public
final
String
toString
(
Role
entityRole
)
{
String
roleString
=
entityRole
==
null
?
""
:
entityRole
.
toString
();
return
toString
().
replace
(
ENTITY_ROLE_PARAMETER
,
roleString
);
}
public
final
String
toString
(
String
transaction
,
String
entityRole
)
{
return
"TRANSACTION:"
+
transaction
+
(
entityRole
!=
null
?
(
":"
+
entityRole
)
:
""
);
public
final
String
toString
(
String
transaction
,
Role
entityRole
)
{
return
"TRANSACTION:"
+
transaction
+
(
entityRole
!=
null
?
(
":"
+
entityRole
.
toString
())
:
""
);
}
public
static
String
init
()
{
...
...
@@ -87,17 +91,16 @@ public class AccessControl extends ContainerJob {
for
(
final
EntityInterface
e
:
getContainer
())
{
// per role permission
if
(
e
instanceof
InsertEntity
)
{
if
(
subject
.
isPermitted
(
INSERT
.
toString
(
e
.
getRole
()
.
toString
()
)))
{
if
(
subject
.
isPermitted
(
INSERT
.
toString
(
e
.
getRole
())))
{
continue
;
}
}
else
if
(
e
instanceof
DeleteEntity
)
{
if
(
subject
.
isPermitted
(
DELETE
.
toString
(
e
.
getRole
()
.
toString
()
)))
{
if
(
subject
.
isPermitted
(
DELETE
.
toString
(
e
.
getRole
())))
{
continue
;
}
}
else
if
(
e
instanceof
UpdateEntity
)
{
if
(
subject
.
isPermitted
(
UPDATE
.
toString
(
e
.
getRole
()
.
toString
()
)))
{
if
(
subject
.
isPermitted
(
UPDATE
.
toString
(
e
.
getRole
())))
{
continue
;
}
}
...
...
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