20 lines
505 B
Go
20 lines
505 B
Go
|
package app
|
||
|
|
||
|
import (
|
||
|
"forge.cadoles.com/arcad/edge/pkg/app"
|
||
|
"forge.cadoles.com/arcad/edge/pkg/app/metadata"
|
||
|
"github.com/pkg/errors"
|
||
|
)
|
||
|
|
||
|
func validateManifest(manifest *app.Manifest) (bool, error) {
|
||
|
valid, err := manifest.Validate(
|
||
|
metadata.WithMinimumRoleValidator(RoleVisitor, RoleUser, RoleSuperuser, RoleAdmin, RoleSuperadmin),
|
||
|
metadata.WithNamedPathsValidator(metadata.NamedPathAdmin, metadata.NamedPathIcon),
|
||
|
)
|
||
|
if err != nil {
|
||
|
return false, errors.WithStack(err)
|
||
|
}
|
||
|
|
||
|
return valid, nil
|
||
|
}
|