// Sets all backups' permissions
483451
func (bp *BackupPerm) SetAll(value bool) {
	bp.Create = value
	bp.Delete = value
	bp.Show = value
}
439955
func (s *ListMailboxPermissionsOutput) SetPermissions(v []*Permission) *ListMailboxPermissionsOutput {
	s.Permissions = v
	return s
}
54659
func (s *GetDisksOutput) SetDisks(v []*Disk) *GetDisksOutput {
	s.Disks = v
	return s
}
985320
func (s *EnvironmentMember) SetPermissions(v string) *EnvironmentMember {
	s.Permissions = &v
	return s
}
267428
func (s *CreateBackupOutput) SetBackup(v *Backup) *CreateBackupOutput {
	s.Backup = v
	return s
}
328723
func (s *DescribeFleetPortSettingsOutput) SetInboundPermissions(v []*IpPermission) *DescribeFleetPortSettingsOutput {
	s.InboundPermissions = v
	return s
}
793313
func (c *Client) BackupSetSchedule(id string, bs BackupSchedule) error {
	values := url.Values{
		"SUBID":     {id},
		"cron_type": {bs.CronType},
		"hour":      {string(bs.Hour)},
		"dow":       {string(bs.Dow)},
		"dom":       {string(bs.Dom)},
	}
	return c.post(`server/backup_set_schedule`, values, nil)
}
834924
func (s *DescribeBackupOutput) SetBackupDescription(v *BackupDescription) *DescribeBackupOutput {
	s.BackupDescription = v
	return s
}
188736
func (s *UpdateServerInput) SetBackupRetentionCount(v int64) *UpdateServerInput {
	s.BackupRetentionCount = &v
	return s
}
1002727
func (s *GetBackupPlanFromJSONOutput) SetBackupPlan(v *Plan) *GetBackupPlanFromJSONOutput {
	s.BackupPlan = v
	return s
}
1150795
func (r Network_Storage_Backup_Evault) GetPermissionsGroups() (resp []datatypes.Network_Storage_Group, err error) {
	err = r.Session.DoRequest("SoftLayer_Network_Storage_Backup_Evault", "getPermissionsGroups", nil, &r.Options, &resp)
	return
}
1117545
func (s *SelectionsListMember) SetBackupPlanId(v string) *SelectionsListMember {
	s.BackupPlanId = &v
	return s
}
1239746
func (s *CreateFleetInput) SetEC2InboundPermissions(v []*IpPermission) *CreateFleetInput {
	s.EC2InboundPermissions = v
	return s
}
161643
func (s *CloneStackInput) SetClonePermissions(v bool) *CloneStackInput {
	s.ClonePermissions = &v
	return s
}
916519
func (s *Service) Permissions(w http.ResponseWriter, r *http.Request) {
	ctx := r.Context()
	srcID, err := paramID("id", r)
	if err != nil {
		Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
		return
	}

	src, err := s.Store.Sources(ctx).Get(ctx, srcID)
	if err != nil {
		notFound(w, srcID, s.Logger)
		return
	}

	ts, err := s.TimeSeries(src)
	if err != nil {
		msg := fmt.Sprintf("unable to connect to source %d: %v", srcID, err)
		Error(w, http.StatusBadRequest, msg, s.Logger)
		return
	}

	if err = ts.Connect(ctx, &src); err != nil {
		msg := fmt.Sprintf("unable to connect to source %d: %v", srcID, err)
		Error(w, http.StatusBadRequest, msg, s.Logger)
		return
	}

	perms := ts.Permissions(ctx)
	if err != nil {
		Error(w, http.StatusBadRequest, err.Error(), s.Logger)
		return
	}
	httpAPISrcs := "/chronograf/v1/sources"
	res := struct {
		Permissions chronograf.Permissions `json:"permissions"`
		Links       map[string]string      `json:"links"` // Links are URI locations related to user
	}{
		Permissions: perms,
		Links: map[string]string{
			"self":   fmt.Sprintf("%s/%d/permissions", httpAPISrcs, srcID),
			"source": fmt.Sprintf("%s/%d", httpAPISrcs, srcID),
		},
	}
	encodeJSON(w, http.StatusOK, res, s.Logger)
}
629864
func (s *Role) SetPermissionsBoundary(v *AttachedPermissionsBoundary) *Role {
	s.PermissionsBoundary = v
	return s
}
352992
func (s *PutUserPermissionsBoundaryInput) SetPermissionsBoundary(v string) *PutUserPermissionsBoundaryInput {
	s.PermissionsBoundary = &v
	return s
}