Skip to content

Commit

Permalink
docs: att readme
Browse files Browse the repository at this point in the history
  • Loading branch information
otaaaviio committed Jun 22, 2024
1 parent 4bad302 commit ed32d4c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ VITE_APP_NAME="${APP_NAME}"
L5_SWAGGER_CONST_HOST=http://project.test/api/v1

# Generate custons keys for Reverb
REVERB_APP_ID=
REVERB_APP_KEY=
REVERB_APP_SECRET=
REVERB_APP_ID=reverb_id
REVERB_APP_KEY=reverb_key
REVERB_APP_SECRET=reverb_secret
REVERB_HOST="localhost"
REVERB_PORT=8080
REVERB_SCHEME=http
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ ps: This step should take a while, because the docker will download the images a
http://0.0.0.0:80
```

5. In .env, you need change this variables for production:

```
REVERB_APP_ID=
REVERB_APP_KEY=
REVERB_APP_SECRET=
```

For the next times, you can use this for stop or start the containers:

```bash
Expand Down
20 changes: 18 additions & 2 deletions app/Policies/GuildPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@

namespace App\Policies;

use App\Enums\Role;
use App\Models\Guild;
use App\Models\GuildMember;
use App\Models\User;

class GuildPolicy
{
public function __construct()
public function view(User $user, Guild $guild): bool
{
//
return $guild->members->contains($user->id);
}

public function updateOrDelete(User $user, Guild $guild): bool
{
return $guild->isUserAdminInGuild($user->id);
}

public function manageChannels(User $user, Guild $guild): bool
{
$guild_member = GuildMember::where('user_id', $user->id)->where('guild_id', $guild->id)->first();

return $guild_member &&
($guild_member->role == Role::Admin->value || $guild_member->role == Role::Moderator->value);
}
}

0 comments on commit ed32d4c

Please sign in to comment.