@@ -20,20 +20,19 @@ export async function grantAWSAccessCommand(
20
20
ctx : ExecutionContext
21
21
) {
22
22
const dev = transformedArgument ?. dev ?. value || false ;
23
- if ( dev ) {
24
- const isUserSuperUser = [ SUPER_USER_ONE , SUPER_USER_TWO ] . includes (
25
- transformedArgument . member . user . id . toString ( )
26
- ) ;
27
- if ( ! isUserSuperUser ) {
28
- const responseText = `You're not authorized to make this request.` ;
29
- return discordTextResponse ( responseText ) ;
30
- }
31
- const roleId = transformedArgument . userDetails . value ;
32
- const groupId = transformedArgument . awsGroupDetails . value ;
33
- const channelId = transformedArgument . channelId ;
34
-
35
- return grantAWSAccess ( roleId , groupId , env , ctx , channelId ) ;
36
- } else {
23
+ if ( ! dev ) {
37
24
return discordTextResponse ( "Please enable feature flag to make this work" ) ;
38
25
}
26
+ const isUserSuperUser = [ SUPER_USER_ONE , SUPER_USER_TWO ] . includes (
27
+ transformedArgument . member . user . id . toString ( )
28
+ ) ;
29
+ if ( ! isUserSuperUser ) {
30
+ const responseText = `You're not authorized to make this request.` ;
31
+ return discordTextResponse ( responseText ) ;
32
+ }
33
+ const roleId = transformedArgument . userDetails . value ;
34
+ const groupId = transformedArgument . awsGroupDetails . value ;
35
+ const channelId = transformedArgument . channelId ;
36
+
37
+ return grantAWSAccess ( roleId , groupId , env , ctx , channelId ) ;
39
38
}
0 commit comments