This module is meant for handling date presets.
- Description:
This module is meant for handling date presets.
- Source:
Members
(inner, constant) PRESET_FIELDS
- Description:
The fields a preset is made of. Used as a projection so a stored document cannot return anything beyond them, and as the shape both write handlers persist.
- Source:
The fields a preset is made of. Used as a projection so a stored document cannot return anything beyond them, and as the shape both write handlers persist.
Methods
(static) create(params) → {boolean}
- Description:
Add new preset
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true if successful
- Type
- boolean
(static) delete(params) → {boolean}
- Description:
Get presets
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true if successful
- Type
- boolean
(static) getAll(params) → {boolean}
- Description:
Get presets
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true if successful
- Type
- boolean
(static) update(params) → {boolean}
- Description:
Update preset
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true if successful
- Type
- boolean
(inner) canEditPreset(preset, member, groups) → {boolean}
- Description:
Whether a member may change a preset rather than only see it. Mirrors what the drawer offers and what the delete handler already requires: the owner, a global admin, or somebody named in one of the edit lists. Being in a view list, or the preset being shared with all users, grants no write.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
preset |
object | the stored preset |
member |
object | params.member |
groups |
array | the member's group ids, as strings |
Returns:
true when the member may edit the preset
- Type
- boolean