2018-09-13 09:23:57 +02:00
|
|
|
import { BaseModel } from '../base/base-model';
|
2018-06-30 16:56:18 +02:00
|
|
|
|
2018-07-12 14:11:31 +02:00
|
|
|
/**
|
|
|
|
* Representation of user group.
|
|
|
|
* @ignore
|
|
|
|
*/
|
2018-09-20 12:25:37 +02:00
|
|
|
export class Group extends BaseModel<Group> {
|
2019-02-01 13:56:08 +01:00
|
|
|
public static COLLECTIONSTRING = 'users/group';
|
2018-08-29 13:21:25 +02:00
|
|
|
public id: number;
|
|
|
|
public name: string;
|
|
|
|
public permissions: string[];
|
2018-06-30 16:56:18 +02:00
|
|
|
|
2018-09-04 11:33:28 +02:00
|
|
|
public constructor(input?: any) {
|
2019-02-01 13:56:08 +01:00
|
|
|
super(Group.COLLECTIONSTRING, input);
|
2018-09-18 18:27:14 +02:00
|
|
|
if (!input) {
|
|
|
|
// permissions are required for new groups
|
|
|
|
this.permissions = [];
|
|
|
|
}
|
2018-06-30 16:56:18 +02:00
|
|
|
}
|
2018-08-31 14:50:38 +02:00
|
|
|
|
2018-09-13 09:23:57 +02:00
|
|
|
public getTitle(): string {
|
2018-09-13 07:57:38 +02:00
|
|
|
return this.name;
|
|
|
|
}
|
2018-06-30 16:56:18 +02:00
|
|
|
}
|