Add 'settings/' from commit '230545a4a75b0611988fbcea51336a6c316d6a3d'
git-subtree-dir: settings git-subtree-mainline:c26f7b390agit-subtree-split:230545a4a7
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package util
|
||||
|
||||
import "github.com/owncloud/ocis-settings/pkg/proto/v0"
|
||||
|
||||
const (
|
||||
// ResourceIDAll declares on a resource that it matches any id
|
||||
ResourceIDAll = "all"
|
||||
)
|
||||
|
||||
// IsResourceMatched checks if the `example` resource is an exact match or a subset of `definition`
|
||||
func IsResourceMatched(definition, example *proto.Resource) bool {
|
||||
if definition.Type != example.Type {
|
||||
return false
|
||||
}
|
||||
return definition.Id == ResourceIDAll || definition.Id == example.Id
|
||||
}
|
||||
Reference in New Issue
Block a user