fix: some user group permissions

These permissions were never meant to be directly edited by staff. They should never have been added to the staff user edit page as it just caused confusion when the settings reset at the daily group change. I've now added these settings to the group directly and allow the settings on the user edit page to override the group settings. I refrained from fixing the can_download permission for now, because so many different things affect it and it will need at 3 separate permissions to control everything it does. Trying to fix it will take much more effort than what can be fixed today. Because of this, I removed the setting from the user edit page to reduce confusion from staff who don't realize it is controlled by the scheduler. Relevant issue: #1820.
This commit is contained in:
Roardom
2024-07-26 21:57:51 +00:00
parent b0ed0263fb
commit 2e91e1157f
35 changed files with 562 additions and 162 deletions
+1 -1
View File
@@ -142,7 +142,7 @@ class ChatController extends Controller
$targeted = $request->input('targeted');
$save = $request->get('save');
if ($user->can_chat === false) {
if (!($user->can_chat ?? $user->group->can_chat)) {
return response('error', 401);
}
@@ -101,7 +101,7 @@ class TorrentController extends BaseController
public function store(Request $request): \Illuminate\Http\JsonResponse
{
$user = $request->user();
abort_if($user->can_upload === false || $user->group->can_upload == 0, 403, __('torrent.cant-upload').' '.__('torrent.cant-upload-desc'));
abort_unless($user->can_upload ?? $user->group->can_upload, 403, __('torrent.cant-upload').' '.__('torrent.cant-upload-desc'));
$requestFile = $request->file('torrent');