improve announce update torrent visible

This commit is contained in:
xiaomlove
2022-07-12 17:42:26 +08:00
parent afa8cdce99
commit 8872abe6b3
22 changed files with 98 additions and 421 deletions
+14 -6
View File
@@ -19,7 +19,7 @@ class TorrentStatePolicy extends BasePolicy
*/
public function viewAny(User $user)
{
//
return true;
}
/**
@@ -31,7 +31,7 @@ class TorrentStatePolicy extends BasePolicy
*/
public function view(User $user, TorrentState $torrentState)
{
//
return true;
}
/**
@@ -42,7 +42,7 @@ class TorrentStatePolicy extends BasePolicy
*/
public function create(User $user)
{
//
return false;
}
/**
@@ -54,7 +54,7 @@ class TorrentStatePolicy extends BasePolicy
*/
public function update(User $user, TorrentState $torrentState)
{
//
return $this->can($user);
}
/**
@@ -66,7 +66,7 @@ class TorrentStatePolicy extends BasePolicy
*/
public function delete(User $user, TorrentState $torrentState)
{
//
}
/**
@@ -78,7 +78,7 @@ class TorrentStatePolicy extends BasePolicy
*/
public function restore(User $user, TorrentState $torrentState)
{
//
}
/**
@@ -92,4 +92,12 @@ class TorrentStatePolicy extends BasePolicy
{
//
}
private function can(User $user)
{
if ($user->class >= User::CLASS_ADMINISTRATOR) {
return true;
}
return false;
}
}