-
Notifications
You must be signed in to change notification settings - Fork 537
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add back InactiveCacheMap and add optional_oauth2 to AutoCofigExclude…
… class
- Loading branch information
Showing
5 changed files
with
45 additions
and
84 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
src/main/java/org/cbioportal/persistence/cachemaputil/InactiveCacheMapUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.cbioportal.persistence.cachemaputil; | ||
|
||
import org.cbioportal.model.CancerStudy; | ||
import org.cbioportal.model.MolecularProfile; | ||
import org.cbioportal.model.SampleList; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.Map; | ||
|
||
@Component | ||
// This implementation of the CacheMapUtils is instantiated on portals where all uses can access any study. | ||
@ConditionalOnProperty(name = "security.method_authorization_enabled", havingValue = "false", matchIfMissing = true) | ||
public class InactiveCacheMapUtil implements CacheMapUtil { | ||
|
||
// Since user-permission evaluation is not needed when this bean is present, throw an error when it is accessed. | ||
|
||
@Override | ||
public Map<String, MolecularProfile> getMolecularProfileMap() { | ||
throw new RuntimeException("A CacheMapUtils method was called on a portal where studies are accessible to all users."); | ||
} | ||
|
||
@Override | ||
public Map<String, SampleList> getSampleListMap() { | ||
throw new RuntimeException("A CacheMapUtils method was called on a portal where studies are accessible to all users."); | ||
} | ||
|
||
@Override | ||
public Map<String, CancerStudy> getCancerStudyMap() { | ||
throw new RuntimeException("A CacheMapUtils method was called on a portal where studies are accessible to all users."); | ||
} | ||
|
||
// bean is only instantiated when there is no user authorization | ||
@Override | ||
public boolean hasCacheEnabled() { | ||
return false; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 0 additions & 79 deletions
79
src/main/java/org/cbioportal/security/config/CustomOAuth2AuthorizationConfig.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters