Commit Graph

248 Commits

Author SHA1 Message Date
DariusIII 06379f25cb Revert "Fix getCategoryExclusionById() excluding every category for role-only users" 2026-07-09 08:14:18 +02:00
joemeyer76 e62724f2cd Fix getCategoryExclusionById() excluding every category for role-only users
RolesAndPermissionsSeeder grants every 'view *' permission via
Role::givePermissionTo() only -- it never grants permissions directly to a
user with User::givePermissionTo(). That is true for every seeded role,
including Admin.

User::getCategoryExclusionById() computed the allowed permission set as:

    $userAllowed = $user->getDirectPermissions()->pluck('name')->toArray();
    $roleAllowed = $user->getAllPermissions()->pluck('name')->toArray();
    $allowed = array_intersect($roleAllowed, $userAllowed);

getAllPermissions() already includes permissions granted via the user's
role(s), so intersecting it with getDirectPermissions() (permissions
assigned directly to the user, bypassing roles) means $allowed is empty
for any user whose permissions come only from their role. Since every
seeded role works this way, this silently excluded every category root
for every user on a fresh install, and any subsequent Newznab/Torznab API
search or browse request returned zero results with no visible error.

Fix: use getAllPermissions() directly, since it already reflects both
role-granted and directly-granted permissions.

Added a regression test (test_role_only_permissions_are_not_excluded)
that mirrors the real seeder setup -- role-only permissions, nothing
granted directly to the user -- to make sure this doesn't regress.
2026-07-03 18:18:46 -04:00
DariusIII 96f6900306 Add user bulk actions 2026-06-15 11:36:03 +02:00
DariusIII d970bbffc6 Improve security 2026-06-12 10:11:15 +02:00
DariusIII f8c52d176e Update expiry email to show pending role. if there is one 2026-05-30 18:15:49 +02:00
DariusIII d747864333 Fix wrong function used 2026-05-21 16:24:45 +02:00
DariusIII c0c153fdf9 Update passkeys - logout other devices 2026-05-08 15:53:58 +02:00
DariusIII ac1ac603cb Update emails 2026-05-07 14:03:21 +02:00
DariusIII c29f5febd5 Add passkey support 2026-04-24 12:03:49 +02:00
DariusIII 1aa9ec1785 Improve speed of user list 2026-04-01 15:05:43 +02:00
DariusIII 7809f54008 Update verification handling 2026-03-29 09:42:55 +02:00
DariusIII 1f031e1284 Update controllers and models 2026-03-26 22:54:34 +01:00
DariusIII 0ea9125286 Fix deprecations 2026-03-26 11:43:32 +01:00
DariusIII 6aee2ef718 Laravel 13 support 2026-03-26 10:48:12 +01:00
DariusIII fe844e652c Fix inactive account removal logic and checks 2026-03-11 17:06:11 +01:00
DariusIII 4bca02f103 Latest pint fixes 2026-03-11 10:11:30 +01:00
DariusIII 01a96bbc43 Declare strict types in classes 2026-02-26 14:26:07 +01:00
DariusIII ec98395cde Small opcode optimizations 2026-02-24 16:40:26 +01:00
DariusIII f4c444c9b0 Update phpstan level to 6 2026-02-11 14:02:26 +01:00
DariusIII c5e55dd562 Fix phpstan reported errors 2026-02-10 16:16:29 +01:00
DariusIII d05eee801f Add country flag 2026-01-27 16:36:03 +01:00
DariusIII 12f60d19d3 Fix country lookup 2026-01-27 15:58:42 +01:00
DariusIII f07f95c6ba Update admin list view 2026-01-27 15:50:29 +01:00
DariusIII f2f946b02d Add per sub-category exclusions to user profile 2026-01-23 15:12:40 +01:00
DariusIII 0c6ce9974a CS fixes 2026-01-07 14:51:28 +01:00
DariusIII a306619824 Fix testing on local database 2025-12-14 20:56:43 +01:00
DariusIII 21ccf85d1f Update stacked role view 2025-12-14 20:11:36 +01:00
DariusIII b0f0e2ac51 Update User model and fix role stacking 2025-12-14 19:50:36 +01:00
DariusIII ef711efd6c Fix role stacking issue 2025-12-14 17:42:01 +01:00
DariusIII b355872696 Fix user upgrade issue 2025-12-04 22:57:42 +01:00
DariusIII ba14bc9c5b Fix couple of issues 2025-12-03 10:01:29 +01:00
DariusIII bb8d5ac038 Update role management 2025-12-02 11:09:34 +01:00
DariusIII 471d2bb496 Add ignored roles 2025-12-02 01:07:06 +01:00
DariusIII 8c675f8235 Update role handling 2025-12-01 23:02:53 +01:00
DariusIII d53954859d Update promotions handling 2025-12-01 13:40:32 +01:00
DariusIII c9293f3969 FIx couple of issues with role stacking 2025-11-30 19:08:01 +01:00
DariusIII a58bd7f435 Update role stacking 2025-11-30 03:10:46 +01:00
DariusIII 5e6864b772 Add account promotions support 2025-11-29 19:54:27 +01:00
DariusIII 5d0f2f10a8 Use only custom validation 2025-11-28 22:13:42 +01:00
DariusIII e168947986 Harden disposable email detection 2025-11-28 17:07:45 +01:00
DariusIII 7dcfdba4de Use ContentController exclusively for content 2025-11-27 11:27:48 +01:00
DariusIII d76bbfbab6 Add more filters to user list 2025-10-29 16:30:12 +01:00
DariusIII 1576dece02 Use better confirmation modals 2025-10-29 15:49:59 +01:00
DariusIII 1c5d75f104 Fix multiple issues and enhance templates 2025-10-26 22:12:10 +01:00
DariusIII a3359c357f Update theme 2025-10-21 16:41:14 +02:00
DariusIII 498881f5a9 Add admin pages to manage invites 2025-08-11 23:20:54 +02:00
DariusIII 88343da88a Add custom invitation system 2025-08-10 23:47:11 +02:00
DariusIII 63d656b0b5 CS fixes 2025-06-06 14:36:34 +02:00
DariusIII 62db82b655 Usde soft deletes so users can be restored 2025-06-06 14:36:13 +02:00
DariusIII 2f5ab2000c Remove userseed from users table 2025-05-04 23:31:49 +02:00