🚑 Fix permission
This commit is contained in:
parent
a3f6adf6f5
commit
1b3bd15aaf
@ -26,35 +26,34 @@ public class GuildController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("mutual")
|
@GetMapping("mutual")
|
||||||
public List<Guild> getMutualGuilds(Authentication authentication){
|
public List<Guild> getMutualGuilds(Authentication authentication) {
|
||||||
JwtPrincipal jwtPrincipal = (JwtPrincipal) authentication.getPrincipal();
|
JwtPrincipal jwtPrincipal = (JwtPrincipal) authentication.getPrincipal();
|
||||||
return guildService.getMutualGuilds(jwtPrincipal.user());
|
return guildService.getMutualGuilds(jwtPrincipal.user());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("inviteLink")
|
@GetMapping("inviteLink")
|
||||||
public InviteLink getInviteLink(){
|
public InviteLink getInviteLink() {
|
||||||
String link = MainBot.jda.getInviteUrl(Permission.ADMINISTRATOR);
|
String link = MainBot.jda.setRequiredScopes("applications.commands").getInviteUrl(Permission.getPermissions(1636113579328L));
|
||||||
return new InviteLink(link);
|
return new InviteLink(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/{guildId}/voiceChannels")
|
@GetMapping("/{guildId}/voiceChannels")
|
||||||
@PreAuthorize("isInGuild(#guildId)")
|
@PreAuthorize("isInGuild(#guildId)")
|
||||||
public List<Channel> getVoiceChannels(@PathVariable String guildId, Authentication authentication){
|
public List<Channel> getVoiceChannels(@PathVariable String guildId, Authentication authentication) {
|
||||||
JwtPrincipal principal = (JwtPrincipal) authentication.getPrincipal();
|
JwtPrincipal principal = (JwtPrincipal) authentication.getPrincipal();
|
||||||
return guildService.getVoiceChannel(guildId, principal.user().getDiscordId());
|
return guildService.getVoiceChannel(guildId, principal.user().getDiscordId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/{guildId}/textChannels")
|
@GetMapping("/{guildId}/textChannels")
|
||||||
@PreAuthorize("isInGuild(#guildId)")
|
@PreAuthorize("isInGuild(#guildId)")
|
||||||
public List<Channel> getTextChannels(@PathVariable String guildId, Authentication authentication){
|
public List<Channel> getTextChannels(@PathVariable String guildId, Authentication authentication) {
|
||||||
JwtPrincipal principal = (JwtPrincipal) authentication.getPrincipal();
|
JwtPrincipal principal = (JwtPrincipal) authentication.getPrincipal();
|
||||||
return guildService.getTextChannel(guildId, principal.user().getDiscordId());
|
return guildService.getTextChannel(guildId, principal.user().getDiscordId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/{guildId}/roles")
|
@GetMapping("/{guildId}/roles")
|
||||||
@PreAuthorize("isInGuild(#guildId)")
|
@PreAuthorize("isInGuild(#guildId)")
|
||||||
public List<Role> getRoles(@PathVariable String guildId){
|
public List<Role> getRoles(@PathVariable String guildId) {
|
||||||
return guildService.getRole(guildId);
|
return guildService.getRole(guildId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user