Skip to content

Commit a1883f6

Browse files
bpamiriclaude
andcommitted
fix: close access control gaps in restrictAccess and admin user actions (wd-u7r)
1. Uncomment redirectTo in restrictAccess() so non-Editor/Admin users are actually redirected away instead of silently proceeding to protected actions. 2. Remove unlockUser,toggleUserLock from checkAdminAccess except list so these admin-only operations require admin role instead of just authentication. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 44fa57d commit a1883f6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/controllers/Controller.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ component extends="wheels.Controller" {
9292

9393
// Allow only specific roles
9494
if (!listFindNoCase("Editor,Admin", session.role)) {
95-
// redirectTo(controller="HomeController", action="index");
95+
redirectTo(controller="HomeController", action="index");
9696
return false;
9797
}
9898

app/controllers/admin/UserController.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ component extends="app.Controllers.Controller" {
55
super.config();
66
verifies(except="index,loadUsers,loadRoles,addUser,store,delete,profile,changePassword,updatePassword,updateProfilePic,checkAdminAccess,unlockUser,toggleUserLock", params="key", paramsTypes="integer", handler="index");
77
usesLayout(template="/admin/AdminController/layout", except="changePassword,updatePassword,updateProfilePic" );
8-
filters(through="checkAdminAccess", except="changePassword,updatePassword,updateProfilePic,unlockUser,toggleUserLock");
8+
filters(through="checkAdminAccess", except="changePassword,updatePassword,updateProfilePic");
99
filters(through="checkUserAccess", only="changePassword,updatePassword,updateProfilePic");
1010
filters(through="checkRoleAccess", only="index,addUser,delete");
1111
}

0 commit comments

Comments
 (0)