mirror of
https://github.com/pgsty/minio.git
synced 2026-11-09 17:21:51 +03:00
fix(iam): separate local policy evaluation from the plugin decision
IsAllowed returns the authorization plugin's decision when a plugin is configured, and evaluates the local policies otherwise. Move the local evaluation into isAllowedLocally so that a caller can combine it with the plugin's decision. IsAllowed is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
@@ -2549,7 +2549,12 @@ func (sys *IAMSys) IsAllowed(args policy.Args) bool {
|
||||
}
|
||||
return ok
|
||||
}
|
||||
return sys.isAllowedLocally(args)
|
||||
}
|
||||
|
||||
// isAllowedLocally evaluates args with the local policies only, as IsAllowed
|
||||
// does when no authorization plugin is configured.
|
||||
func (sys *IAMSys) isAllowedLocally(args policy.Args) bool {
|
||||
// Policies don't apply to the owner.
|
||||
if args.IsOwner {
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user