Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission middleware check condition incorrect. #5880

Open
Dennies-Chang opened this issue Feb 25, 2025 · 0 comments
Open

Permission middleware check condition incorrect. #5880

Dennies-Chang opened this issue Feb 25, 2025 · 0 comments

Comments

@Dennies-Chang
Copy link

The condition Line 32 in src/Middleware/Permission.php is incorrect.

The code is:
if (!Admin::user() || !empty($args) || $this->shouldPassThrough($request)) {
return $next($request);
}

However if I used as sample code, the $args will be "not empty", and the condition will be always true,
and the permission check logic will never be used.

It should be corrected as:
if (!Admin::user() || empty($args) || $this->shouldPassThrough($request)) {
return $next($request);
}

The "!" prefixed for empty($args) should be removed, would you please fix it? Thanks.

Best Regards,
Dennies Chang.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant