Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
cbeb7eea
Commit
cbeb7eea
authored
12 years ago
by
brinn
Browse files
Options
Downloads
Patches
Plain Diff
Tighten authorization check.
SVN: 26172
parent
e8c10517
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/api/internal/authorization/ScreeningPlateListReadOnlyPredicate.java
+17
-11
17 additions, 11 deletions
...al/authorization/ScreeningPlateListReadOnlyPredicate.java
with
17 additions
and
11 deletions
screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/api/internal/authorization/ScreeningPlateListReadOnlyPredicate.java
+
17
−
11
View file @
cbeb7eea
...
@@ -32,6 +32,7 @@ import ch.systemsx.cisd.openbis.generic.shared.authorization.RoleWithIdentifier;
...
@@ -32,6 +32,7 @@ import ch.systemsx.cisd.openbis.generic.shared.authorization.RoleWithIdentifier;
import
ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.ShouldFlattenCollections
;
import
ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.ShouldFlattenCollections
;
import
ch.systemsx.cisd.openbis.generic.shared.authorization.predicate.AbstractSpacePredicate
;
import
ch.systemsx.cisd.openbis.generic.shared.authorization.predicate.AbstractSpacePredicate
;
import
ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE
;
import
ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE
;
import
ch.systemsx.cisd.openbis.generic.shared.dto.exception.UndefinedSpaceException
;
import
ch.systemsx.cisd.openbis.generic.shared.util.SpaceCodeHelper
;
import
ch.systemsx.cisd.openbis.generic.shared.util.SpaceCodeHelper
;
import
ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateIdentifier
;
import
ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.PlateIdentifier
;
...
@@ -62,22 +63,27 @@ public class ScreeningPlateListReadOnlyPredicate extends
...
@@ -62,22 +63,27 @@ public class ScreeningPlateListReadOnlyPredicate extends
final
List
<
String
>
permIds
=
new
ArrayList
<
String
>(
plates
.
size
());
final
List
<
String
>
permIds
=
new
ArrayList
<
String
>(
plates
.
size
());
for
(
PlateIdentifier
plate
:
plates
)
for
(
PlateIdentifier
plate
:
plates
)
{
{
boolean
hasPermId
=
false
;
if
(
plate
.
getPermId
()
!=
null
)
if
(
plate
.
getPermId
()
!=
null
)
{
{
permIds
.
add
(
plate
.
getPermId
());
permIds
.
add
(
plate
.
getPermId
());
}
else
hasPermId
=
true
;
}
final
String
spaceCodeOrNull
=
SpaceCodeHelper
.
getSpaceCode
(
person
,
plate
.
tryGetSpaceCode
());
if
(
spaceCodeOrNull
==
null
&&
hasPermId
==
false
)
{
throw
new
UndefinedSpaceException
();
}
if
(
spaceCodeOrNull
!=
null
&&
plate
.
isSharedPlate
()
==
false
)
{
{
final
String
spaceCode
=
final
Status
status
=
SpaceCodeHelper
.
getSpaceCode
(
person
,
plate
.
tryGetSpaceCode
());
evaluate
(
person
,
allowedRoles
,
authorizationDataProvider
if
(
plate
.
isSharedPlate
()
==
false
)
.
getHomeDatabaseInstance
(),
spaceCodeOrNull
);
if
(
Status
.
OK
.
equals
(
status
)
==
false
)
{
{
final
Status
status
=
return
status
;
evaluate
(
person
,
allowedRoles
,
authorizationDataProvider
.
getHomeDatabaseInstance
(),
spaceCode
);
if
(
Status
.
OK
.
equals
(
status
)
==
false
)
{
return
status
;
}
}
}
}
}
}
}
...
...
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