class ZoneTemplateGroupShares (View source)

Which user groups a zone template is shared with. The owner shares with groups they belong to, a ueberuser with any group; members of a group see, apply and (with zone_templ_edit) edit the template.

Methods

array
shareableGroups(int $userId)

Groups the user may add to or remove from a template's share list.

array
sharedGroups(int $zone_templ_id, int $userId)

Groups the template is shared with, as the user may see them.

refusal(int $zone_templ_id, array $submittedGroupIds, int $userId)

Refusal for a share list update(), or null when it would be accepted. Lets a caller check the list before saving the rest of the form.

groupsForNewTemplate(array $submittedGroupIds, int $userId)

The groups a template being created is shared with, or the refusal. The creator becomes the owner, so the owner's rules apply.

update(int $zone_templ_id, array $submittedGroupIds, int $userId)

Set the template's share list to the submitted groups. Stored groups the user may not share with stay as they are; submitting one that is not stored is refused.

Details

array shareableGroups(int $userId)

Groups the user may add to or remove from a template's share list.

Parameters

int $userId

Return Value

array

array sharedGroups(int $zone_templ_id, int $userId)

Groups the template is shared with, as the user may see them.

Parameters

int $zone_templ_id
int $userId

Return Value

array

ZoneTemplateWriteResult|null refusal(int $zone_templ_id, array $submittedGroupIds, int $userId)

Refusal for a share list update(), or null when it would be accepted. Lets a caller check the list before saving the rest of the form.

Parameters

int $zone_templ_id
array $submittedGroupIds
int $userId

Return Value

ZoneTemplateWriteResult|null

ZoneTemplateWriteResult|array groupsForNewTemplate(array $submittedGroupIds, int $userId)

The groups a template being created is shared with, or the refusal. The creator becomes the owner, so the owner's rules apply.

Parameters

array $submittedGroupIds
int $userId

Return Value

ZoneTemplateWriteResult|array

ZoneTemplateWriteResult update(int $zone_templ_id, array $submittedGroupIds, int $userId)

Set the template's share list to the submitted groups. Stored groups the user may not share with stay as they are; submitting one that is not stored is refused.

Parameters

int $zone_templ_id
array $submittedGroupIds
int $userId

Return Value

ZoneTemplateWriteResult