Skip to content

Commit e6e6b67

Browse files
committed
update api security config
1 parent 1fc4dd5 commit e6e6b67

File tree

2 files changed

+37
-40
lines changed

2 files changed

+37
-40
lines changed

src/main/java/org/mskcc/cbio/oncokb/config/SecurityConfiguration.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public void configure(HttpSecurity http) throws Exception {
9494
.antMatchers("/api/slack").permitAll()
9595
// Permits the api swagger definitions through proxy
9696
.antMatchers("/api/v1/v2/api-docs").permitAll()
97-
.antMatchers("/api/private/utils/data/**").hasAnyAuthority(AuthoritiesConstants.DATA_DOWNLOAD)
97+
.antMatchers("/api/private/utils/data/**").hasAnyAuthority(AuthoritiesConstants.DATA_DOWNLOAD, AuthoritiesConstants.PREMIUM_USER)
9898

9999
.antMatchers("/api/v1/annotate/sample").hasAnyAuthority(AuthoritiesConstants.PREMIUM_USER, AuthoritiesConstants.ADMIN) // Order matters here
100100
.antMatchers("/api/v1/annotate/**").hasAnyAuthority(AuthoritiesConstants.API, AuthoritiesConstants.ROLE_SERVICE_ACCOUNT)
@@ -113,9 +113,9 @@ public void configure(HttpSecurity http) throws Exception {
113113
.antMatchers("/api/v1/annotation/search").hasAnyAuthority(AuthoritiesConstants.PREMIUM_USER, AuthoritiesConstants.ADMIN)
114114
.antMatchers("/api/v1/drugs").hasAnyAuthority(AuthoritiesConstants.PREMIUM_USER, AuthoritiesConstants.ADMIN)
115115
.antMatchers("/api/v1/utils/allActionableVariants").hasAnyAuthority(AuthoritiesConstants.PREMIUM_USER, AuthoritiesConstants.ADMIN)
116-
.antMatchers("/api/v1/utils/allActionableVariants.txt").hasAnyAuthority(AuthoritiesConstants.PREMIUM_USER, AuthoritiesConstants.ADMIN)
116+
.antMatchers("/api/v1/utils/allActionableVariants.txt").hasAnyAuthority(AuthoritiesConstants.PREMIUM_USER, AuthoritiesConstants.ADMIN, AuthoritiesConstants.DATA_DOWNLOAD)
117117
.antMatchers("/api/v1/utils/allAnnotatedVariants").hasAnyAuthority(AuthoritiesConstants.PREMIUM_USER, AuthoritiesConstants.ADMIN)
118-
.antMatchers("/api/v1/utils/allAnnotatedVariants.txt").hasAnyAuthority(AuthoritiesConstants.PREMIUM_USER, AuthoritiesConstants.ADMIN)
118+
.antMatchers("/api/v1/utils/allAnnotatedVariants.txt").hasAnyAuthority(AuthoritiesConstants.PREMIUM_USER, AuthoritiesConstants.ADMIN, AuthoritiesConstants.DATA_DOWNLOAD)
119119
.antMatchers("/api/v1/utils/allVariantsOfUnknownSignificance").hasAnyAuthority(AuthoritiesConstants.PREMIUM_USER, AuthoritiesConstants.ADMIN)
120120
.antMatchers("/api/v1/utils/allVariantsOfUnknownSignificance.txt").hasAnyAuthority(AuthoritiesConstants.PREMIUM_USER, AuthoritiesConstants.ADMIN)
121121

src/main/webapp/app/pages/apiAccessGroup/APIAccessPage.tsx

+34-37
Original file line numberDiff line numberDiff line change
@@ -83,41 +83,35 @@ const DownloadButtonGroups: React.FunctionComponent<{
8383
buttonText="Cancer Gene List"
8484
/>
8585
) : null}
86-
{props.authenticationStore.account?.authorities.includes(
87-
USER_AUTHORITY.ROLE_PREMIUM_USER
88-
) && (
89-
<>
90-
{props.data.hasAllActionableVariants && (
91-
<AuthDownloadButton
92-
className={BUTTON_CLASS_NAME}
93-
fileName={`all_actionable_variants_${props.data.version}.tsv`}
94-
getDownloadData={async () => {
95-
const data = await oncokbClient.utilsAllActionableVariantsTxtGetUsingGET(
96-
{
97-
version: props.data.version,
98-
}
99-
);
100-
return data;
101-
}}
102-
buttonText="All Actionable Variants"
103-
/>
104-
)}
105-
{props.data.hasAllAnnotatedVariants && (
106-
<AuthDownloadButton
107-
className={BUTTON_CLASS_NAME}
108-
fileName={`all_annotated_variants_${props.data.version}.tsv`}
109-
getDownloadData={async () => {
110-
const data = await oncokbClient.utilsAllAnnotatedVariantsTxtGetUsingGET(
111-
{
112-
version: props.data.version,
113-
}
114-
);
115-
return data;
116-
}}
117-
buttonText="All Annotated Variants"
118-
/>
119-
)}
120-
</>
86+
{props.data.hasAllActionableVariants && (
87+
<AuthDownloadButton
88+
className={BUTTON_CLASS_NAME}
89+
fileName={`all_actionable_variants_${props.data.version}.tsv`}
90+
getDownloadData={async () => {
91+
const data = await oncokbClient.utilsAllActionableVariantsTxtGetUsingGET(
92+
{
93+
version: props.data.version,
94+
}
95+
);
96+
return data;
97+
}}
98+
buttonText="All Actionable Variants"
99+
/>
100+
)}
101+
{props.data.hasAllAnnotatedVariants && (
102+
<AuthDownloadButton
103+
className={BUTTON_CLASS_NAME}
104+
fileName={`all_annotated_variants_${props.data.version}.tsv`}
105+
getDownloadData={async () => {
106+
const data = await oncokbClient.utilsAllAnnotatedVariantsTxtGetUsingGET(
107+
{
108+
version: props.data.version,
109+
}
110+
);
111+
return data;
112+
}}
113+
buttonText="All Annotated Variants"
114+
/>
121115
)}
122116
{props.data.hasSqlDump ? (
123117
<>
@@ -288,9 +282,12 @@ export default class APIAccessPage extends React.Component<{
288282
</div>
289283
</div>
290284
{this.props.authenticationStore.account &&
291-
this.props.authenticationStore.account.authorities.includes(
285+
(this.props.authenticationStore.account.authorities.includes(
292286
USER_AUTHORITY.ROLE_DATA_DOWNLOAD
293-
) ? (
287+
) ||
288+
this.props.authenticationStore.account.authorities.includes(
289+
USER_AUTHORITY.ROLE_PREMIUM_USER
290+
)) ? (
294291
<>
295292
<div className={'mb-3'}>
296293
<h5 className="title">Data Download</h5>

0 commit comments

Comments
 (0)