// CheckPrivs reports if the Peer has all ofthe specified privileges
CheckPrivs reports if the Peer has all ofthe specified privileges
// CheckPrivs reports if the Peer has all ofthe specified privileges
func (p *Peer) CheckPrivs(req map[string]bool) (bool, error) {
	privs, err := p.GetPrivs()
	if err != nil {
		return false, err
	}
	allow := true
	for priv := range req {
		if req[priv] && !privs[priv] {
			allow = false
			break
		}
	}
	return allow, nil
}
func ( p * Peer ) CheckPrivs ( req map [ string ] bool ) ( bool , error ) { privs , err := p . GetPrivs ( ) if err != nil { return false , err } allow := true for priv := range req { if req [ priv ] && ! privs [ priv ] { allow = false break } } return allow , nil }
CheckPrivs reports if the Peer has all ofthe specified privileges
CheckPrivs reports if the Peer has all ofthe specified privileges