File tree 2 files changed +3
-3
lines changed
src/main/java/edu/kit/datamanager/repo/service/impl 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
### Added
10
10
11
11
### Fixed
12
+ * Fixed potential issue with unprivileged find
12
13
13
14
### Security
14
15
Original file line number Diff line number Diff line change @@ -502,7 +502,7 @@ private Page<DataResource> doFind(
502
502
logger .trace ("Checking example for state information." );
503
503
if (example != null && example .getState () != null ) {
504
504
//example is set...check if example state should be used
505
- if (includeRevoked || !DataResource .State .REVOKED .equals (example .getSubjects ())) {
505
+ if (includeRevoked || !DataResource .State .REVOKED .equals (example .getState ())) {
506
506
logger .trace ("Adding state {} from example." , example .getState ());
507
507
//we either are allowed to include revoked state or the state is not 'REVOKED', add state from example
508
508
states .add (example .getState ());
@@ -513,12 +513,11 @@ private Page<DataResource> doFind(
513
513
514
514
if (states .isEmpty ()) {
515
515
logger .trace ("No state element received from example. Adding default states VOLATILE and FIXED." );
516
- //No state obtained from example...adding default states VOLATILE and FIXED
517
516
states .add (DataResource .State .VOLATILE );
518
517
states .add (DataResource .State .FIXED );
519
518
}
520
519
521
- if (includeRevoked ) {
520
+ if (includeRevoked && ! states . contains ( DataResource . State . REVOKED ) ) {
522
521
logger .trace ("Flag 'includeRevoked' is enabled. Adding states REVOKED." );
523
522
//Add REVOKED state in case this is allowed (e.g. admin access)
524
523
states .add (DataResource .State .REVOKED );
You can’t perform that action at this time.
0 commit comments