Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed races character datagrid #911

Merged
merged 5 commits into from
Jul 8, 2024
Merged

Conversation

spitfire305
Copy link
Collaborator

No description provided.

@ilestis ilestis self-requested a review July 8, 2024 18:23
Copy link
Member

@ilestis ilestis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code seems overly complicated

@@ -44,6 +49,15 @@ public function race(): BelongsTo

public function getCharacterRacesAttribute()
{
return $this->character->races;
if (auth()->check() && auth()->user()->isAdmin()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems overly complicated. How is it done in the org members view? The model shouldn't have any concept of is a user is an admin or not, that's the policy's job

@spitfire305 spitfire305 requested a review from ilestis July 8, 2024 19:22
@ilestis ilestis merged commit e71b474 into develop Jul 8, 2024
@ilestis ilestis deleted the race-overview-character-bug branch July 8, 2024 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants