|
| 1 | +/* |
| 2 | + * Copyright (C) NIWA & British Crown (Met Office) & Contributors. |
| 3 | + * |
| 4 | + * This program is free software: you can redistribute it and/or modify |
| 5 | + * it under the terms of the GNU General Public License as published by |
| 6 | + * the Free Software Foundation, either version 3 of the License, or |
| 7 | + * (at your option) any later version. |
| 8 | + * |
| 9 | + * This program is distributed in the hope that it will be useful, |
| 10 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | + * GNU General Public License for more details. |
| 13 | + * |
| 14 | + * You should have received a copy of the GNU General Public License |
| 15 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | + */ |
| 17 | + |
| 18 | +export default class User { |
| 19 | + constructor ( |
| 20 | + /** The authenticated user (full info only available when authenticated |
| 21 | + * via the hub) */ |
| 22 | + public username: string, |
| 23 | + /** User groups */ |
| 24 | + public groups: string[], |
| 25 | + /** Date when the user was created */ |
| 26 | + public created: string, |
| 27 | + /** Whether the user is an administrator or not */ |
| 28 | + public admin: boolean, |
| 29 | + /** Server URL */ |
| 30 | + public server: string, |
| 31 | + /** UIS owner (the user whose workflows we are looking at) (this might not |
| 32 | + * be the authenticated user for multi-user setups) */ |
| 33 | + public owner: string, |
| 34 | + /** List of permissions */ |
| 35 | + public permissions: string[], |
| 36 | + public mode: 'single user' | 'multi user', |
| 37 | + /** User initials */ |
| 38 | + public initials: string |
| 39 | + ) { |
| 40 | + this.server ||= '?' // server can be unset |
| 41 | + } |
| 42 | +} |
0 commit comments