*/
public function viewAny(User $user)
{
- return $user->isAdmin();
+ return true;
}
/**
*/
public function view(User $user, Participant $participant)
{
- return $user->isAdmin();
+ return true;
}
/**
*/
public function update(User $user, Participant $participant)
{
- return $user->isAdmin();
+ return false;
}
/**
*/
public function viewAny(User $user)
{
- return $user->role === 'admin';
+ return false;
}
/**
*/
public function view(User $user, Protocol $protocol)
{
- return $user->role === 'admin';
+ return $user->isTournamentCrew($protocol->tournament);
}
/**
*/
public function create(User $user)
{
- return $user->role === 'admin';
+ return false;
}
/**
*/
public function update(User $user, Round $round)
{
- return $user->role === 'admin';
+ return false;
}
/**
*/
public function setSeed(User $user, Round $round)
{
- return !$round->locked && ($user->isAdmin() || $user->isRunner($round->tournament) || $user->isTournamentAdmin($round->tournament));
+ return !$round->locked && ($user->isRunner($round->tournament) || $user->isTournamentAdmin($round->tournament));
}
/**
*/
public function lock(User $user, Round $round)
{
- return !$round->tournament->locked && ($user->isAdmin() || $user->isTournamentAdmin($round->tournament));
+ return !$round->tournament->locked && ($user->isTournamentAdmin($round->tournament));
}
/**
*/
public function create(User $user)
{
- return $user->role === 'admin';
+ return $user->isAdmin();
}
/**
*/
public function update(User $user, Tournament $tournament)
{
- return $user->role === 'admin';
+ return $user->isTournamentAdmin($tournament);
}
/**
*/
public function addRound(User $user, Tournament $tournament)
{
- return !$tournament->locked && ($user->isAdmin() || $user->isRunner($tournament) || $user->isTournamentAdmin($tournament));
+ return !$tournament->locked && ($user->isRunner($tournament) || $user->isTournamentAdmin($tournament));
}
/**
*/
public function viewProtocol(User $user, Tournament $tournament)
{
- return $user->isAdmin() || $user->isTournamentCrew($tournament);
+ return $user->isTournamentCrew($tournament);
}
}
export const mayAddRounds = (user, tournament) =>
!tournament.locked &&
- (isAdmin(user) || isRunner(user, tournament) || isTournamentAdmin(user, tournament));
+ (isRunner(user, tournament) || isTournamentAdmin(user, tournament));
export const mayLockRound = (user, tournament) =>
- !tournament.locked && (isAdmin(user) || isTournamentAdmin(user, tournament));
+ !tournament.locked && isTournamentAdmin(user, tournament);
export const maySetSeed = (user, tournament, round) =>
!round.locked &&
- (isAdmin(user) || isRunner(user, tournament) || isTournamentAdmin(user, tournament));
+ (isRunner(user, tournament) || isTournamentAdmin(user, tournament));
export const mayViewProtocol = (user, tournament) =>
- isAdmin(user) || isTournamentCrew(user, tournament);
+ isTournamentCrew(user, tournament);
export const maySeeResults = (user, tournament, round) =>
round.locked ||
// Users
export const mayEditNickname = (user, subject) =>
- isAdmin(user) || isSameUser(user, subject);
+ isSameUser(user, subject);
export const mayEditStreamLink = (user, subject) =>
- isAdmin(user) || isSameUser(user, subject);
+ isSameUser(user, subject);