@@ -20,20 +20,19 @@ export async function grantAWSAccessCommand(
2020 ctx : ExecutionContext
2121) {
2222 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 ) {
3724 return discordTextResponse ( "Please enable feature flag to make this work" ) ;
3825 }
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 ) ;
3938}
0 commit comments