mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
3c1bb3ec19
This adds an option to match domains by regex including two special named matching groups. User matches the username of the user, and Group matches the groups a user is a member of. These are both case-insensitive and you can see examples in the docs.
16 lines
345 B
Go
16 lines
345 B
Go
package authorization
|
|
|
|
import (
|
|
"regexp"
|
|
)
|
|
|
|
// AccessControlResource represents an ACL resource.
|
|
type AccessControlResource struct {
|
|
Pattern regexp.Regexp
|
|
}
|
|
|
|
// IsMatch returns true if the ACL resource match the object path.
|
|
func (acr AccessControlResource) IsMatch(object Object) (match bool) {
|
|
return acr.Pattern.MatchString(object.Path)
|
|
}
|