@@ -52,6 +52,7 @@ function getMinorVersion(versionString: string): number | undefined {
52
52
const BUTTON_CLASS_NAME = 'mr-2 my-1' ;
53
53
const DownloadButtonGroups : React . FunctionComponent < {
54
54
data : DownloadAvailabilityWithDate ;
55
+ authenticationStore : AuthenticationStore ;
55
56
} > = props => {
56
57
const majorVersion = getMajorVersion ( props . data . version ) ?? 0 ;
57
58
const minorVersion = getMinorVersion ( props . data . version ) ?? 0 ;
@@ -82,22 +83,43 @@ const DownloadButtonGroups: React.FunctionComponent<{
82
83
buttonText = "Cancer Gene List"
83
84
/>
84
85
) : null }
85
- { props . data . hasAllAnnotatedVariants && (
86
- < AuthDownloadButton
87
- className = { BUTTON_CLASS_NAME }
88
- fileName = { `all_annotated_variants_${ props . data . version } .tsv` }
89
- getDownloadData = { async ( ) => {
90
- const data = await oncokbClient . utilsAllAnnotatedVariantsTxtGetUsingGET (
91
- {
92
- version : props . data . version ,
93
- }
94
- ) ;
95
- return data ;
96
- } }
97
- buttonText = "All Annotated Variants"
98
- />
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
+ </ >
99
121
) }
100
- { props . data . hasAllActionableVariants ? (
122
+ { props . data . hasSqlDump ? (
101
123
< >
102
124
< AuthDownloadButton
103
125
className = { BUTTON_CLASS_NAME }
@@ -291,6 +313,7 @@ export default class APIAccessPage extends React.Component<{
291
313
</ p >
292
314
< DownloadButtonGroups
293
315
data = { this . dataAvailability . result [ 0 ] }
316
+ authenticationStore = { this . props . authenticationStore }
294
317
/>
295
318
296
319
{ this . dataAvailability . result . length > 1 ? (
@@ -326,6 +349,9 @@ export default class APIAccessPage extends React.Component<{
326
349
< Col >
327
350
< DownloadButtonGroups
328
351
data = { this . selectedData }
352
+ authenticationStore = {
353
+ this . props . authenticationStore
354
+ }
329
355
/>
330
356
</ Col >
331
357
</ Row >
0 commit comments