code: func BucketPermissions(c context.Context, client access.AccessClient, buckets []string) (Permissions, time.Duration, error) {
  	// Make permitted actions call.
  	req := access.PermittedActionsRequest{
  		ResourceKind: "bucket",
  		ResourceIds:  buckets,
  	}
  	resp, err := client.PermittedActions(c, &req)
  	if err != nil {
  		return nil, 0, err
  	}
  
  	// Parse proto into a convenient format.
  	perms := make(Permissions, len(resp.Permitted))
  	if err := perms.FromProto(resp); err != nil {
  		return nil, 0, err
  	}
  	dur, err := ptypes.Duration(resp.ValidityDuration)
  	if err != nil {
  		return nil, 0, err
  	}
  	return perms, dur, nil
  }
docs: // BucketPermissions retrieves permitted actions for a set of buckets, for the
  // identity specified in the client. It also returns the duration for which the
  // client is allowed to cache the permissions.