|
1 |
| -/** |
| 1 | +/* |
2 | 2 | * Copyright (C) NIWA & British Crown (Met Office) & Contributors.
|
3 | 3 | *
|
4 | 4 | * This program is free software: you can redistribute it and/or modify
|
|
15 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16 | 16 | */
|
17 | 17 |
|
18 |
| -/** |
19 |
| - * @typedef {object} User |
20 |
| - * @property {string} username - user name |
21 |
| - * @property {string[]} groups - user groups |
22 |
| - * @property {string} created - date when the user was created |
23 |
| - * @property {boolean} admin - whether the user is an administrator or not |
24 |
| - * @property {string} server - server URL |
25 |
| - * @property {string} owner - UIS owner |
26 |
| - * @property {string[]} permissions - list of permissions |
27 |
| - * @property {string} mode - single or multi user mode |
28 |
| - * @property {string} initials - user initials |
29 |
| - */ |
30 | 18 | export default class User {
|
31 |
| - constructor (username, groups, created, admin, server, owner, permissions, mode, initials) { |
32 |
| - // the authenticated user |
33 |
| - // (full info only available when authenticated via the hub) |
| 19 | + constructor ({ username, owner, permissions, mode, initials, color }) { |
| 20 | + /** |
| 21 | + * @type {string} |
| 22 | + */ |
34 | 23 | this.username = username
|
35 |
| - this.groups = groups |
36 |
| - this.created = created |
37 |
| - this.admin = admin |
38 |
| - this.server = server || '?' // server can be unset |
39 |
| - // the UIS owner |
40 |
| - // (i.e. the user who's workflows we are looking at) |
41 |
| - // (this might not be the authenticated user for multi-user setups) |
| 24 | + /** |
| 25 | + * the UIS owner (i.e. the user who's workflows we are looking at) |
| 26 | + * (this might not be the authenticated user for multi-user setups) |
| 27 | + * @type {string} |
| 28 | + */ |
42 | 29 | this.owner = owner
|
| 30 | + /** |
| 31 | + * list of permissions |
| 32 | + * @type {string[]} |
| 33 | + */ |
43 | 34 | this.permissions = permissions
|
| 35 | + /** |
| 36 | + * single or multi user mode |
| 37 | + * @type {string} |
| 38 | + */ |
44 | 39 | this.mode = mode
|
| 40 | + /** |
| 41 | + * user initials |
| 42 | + * @type {string} |
| 43 | + */ |
45 | 44 | this.initials = initials
|
| 45 | + /** |
| 46 | + * user avatar color if set |
| 47 | + * @type {string | null} |
| 48 | + */ |
| 49 | + this.color = color |
46 | 50 | }
|
47 | 51 | }
|
0 commit comments