// FromConfigFile parses configuration file from a path and returns
// authorization policies. Supports yaml, json.
FromConfigFile parses configuration file from a path and returns
authorization policies. Supports yaml, json.
// FromConfigFile parses configuration file from a path and returns // authorization policies . Supports yaml json .
func FromConfigFile(f string) ([]Policy, error) {
	exists, err := fileutil.IsReadableFile(f)
	if err != nil || !exists {
		return nil, fmt.Errorf("policy file %v: %v exists? %v", f, err, exists)
	}
	confBytes, err := ioutil.ReadFile(f)
	if err != nil {
		return nil, err
	}
	return FromConfig(confBytes)
}
func FromConfigFile ( f string ) ( [ ] Policy , error ) { exists , err := fileutil . IsReadableFile ( f ) if err != nil || ! exists { return nil , fmt . Errorf ( " " , f , err , exists ) } confBytes , err := ioutil . ReadFile ( f ) if err != nil { return nil , err } return FromConfig ( confBytes ) }
FromConfigFile parses configuration file from a path and returns
authorization policies.
FromConfigFile parses configuration file from a path and returns authorization policies .