Skip to content

Commit 0d23f81

Browse files
fix: allow manager_user and list_user policies to access user manager (#614)
1 parent b34d505 commit 0d23f81

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/js/auth.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,14 @@ const isAuth = async (req, res, next) => {
556556
}
557557
}
558558
} else if (url.match(/\/auth\/(?!login).*/)) {
559-
if (policies.some((r) => r.name === POLICIES.SUPER_PERMISSION)) {
559+
if (
560+
policies.some(
561+
(r) =>
562+
r.name === POLICIES.SUPER_PERMISSION ||
563+
r.name === POLICIES.MANAGER_USER ||
564+
r.name === POLICIES.LIST_USER,
565+
)
566+
) {
560567
next();
561568
return;
562569
} else {
@@ -631,6 +638,8 @@ const isAuth = async (req, res, next) => {
631638
organization,
632639
[
633640
POLICIES.SUPER_PERMISSION,
641+
POLICIES.MANAGER_USER,
642+
POLICIES.LIST_USER,
634643
POLICIES.LIST_TREE,
635644
POLICIES.APPROVE_TREE,
636645
POLICIES.MANAGE_PLANTER,

0 commit comments

Comments
 (0)