Skip to content

Commit edf6cdd

Browse files
committedApr 4, 2024·
fix ACL issues
1 parent 1521061 commit edf6cdd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎lib/Sparky/Security.rakumod

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ sub check-user (Mu $user, Mu $token, $project?) is export {
1818

1919
if "{cache-root()}/users/{$user}/tokens/{$token}".IO ~ :f {
2020
#say "user $user, token - $token - validation passed";
21+
return True unless $project;
2122
my $list = load-acl-list();
2223
# in case no ACL, allow all authenticated users to do all
2324
unless $list {
2425
say "check-user: no ACL found, allow user [$user] on default basis";
2526
return True
2627
}
28+
2729
say "check-user: ACL loaded: {$list.perl}";
2830

2931
if $project &&
@@ -49,7 +51,7 @@ sub check-user (Mu $user, Mu $token, $project?) is export {
4951
$list<global><allow><users>.isa(Array) &&
5052
$list<global><allow><users>.Set{$user} {
5153
say "check-user: allow user [$user] build project [$project] on global allow basis";
52-
return False;
54+
return True;
5355
} else {
5456
say "check-user: allow user [$user] build project [$project] on default basis";
5557
return True
@@ -97,4 +99,4 @@ sub load-acl-list {
9799
return
98100
}
99101

100-
}
102+
}

0 commit comments

Comments
 (0)
Please sign in to comment.