master #475

Closed
edraft wants to merge 60 commits from master into dev
2 changed files with 11 additions and 1 deletions
Showing only changes of commit fbdac4f57a - Show all commits

View File

@ -30,6 +30,7 @@ from bot_data.model.user_joined_game_server import UserJoinedGameServer
from bot_data.model.user_joined_server import UserJoinedServer
from bot_data.model.user_joined_voice_channel import UserJoinedVoiceChannel
from bot_data.model.user_role_enum import UserRoleEnum
from bot_data.model.user_warnings import UserWarnings
from bot_graphql.abc.filter_abc import FilterABC
from bot_graphql.filter.page import Page
from bot_graphql.filter.sort import Sort
@ -164,6 +165,15 @@ class QueryABC(ObjectType):
access = True
break
elif type(element) == UserWarnings:
for u in user.users:
u: User = u
guild = bot.get_guild(u.server.discord_id)
member = guild.get_member(u.discord_id)
if u.id == element.user.id or permissions.is_member_moderator(member):
access = True
break
elif type(element) == UserJoinedServer:
for u in user.users:
u: User = u

View File

@ -79,11 +79,11 @@ export class UserWarningComponent extends ComponentWithTable implements OnInit,
public ngOnInit(): void {
this.loading = true;
this.setFilterForm();
this.data.getServerFromRoute(this.route).then(async server => {
this.server = server;
let authUser = await this.authService.getLoggedInUser();
this.user = authUser?.users?.find(u => u.server == this.server.id) ?? null;
this.setFilterForm();
});
}