code: func (p Permissions) ToProto(validTime time.Duration) *access.PermittedActionsResponse {
  	perms := make(map[string]*access.PermittedActionsResponse_ResourcePermissions, len(p))
  	for bucket, action := range p {
  		var actions []string
  		for a, name := range actionToName {
  			if action&a == a {
  				actions = append(actions, name)
  			}
  		}
  		sort.Strings(actions)
  		perms[bucket] = &access.PermittedActionsResponse_ResourcePermissions{Actions: actions}
  	}
  	return &access.PermittedActionsResponse{
  		Permitted:        perms,
  		ValidityDuration: ptypes.DurationProto(validTime),
  	}
  }
docs: // ToProto converts a Permissions into a PermittedActionsResponse.