Files
smartsocket/ts/smartsocket.classes.socketrole.ts

30 lines
733 B
TypeScript
Raw Normal View History

2018-03-15 02:29:40 +01:00
import * as plugins from './smartsocket.plugins';
2016-08-07 14:58:20 +02:00
2016-08-07 18:59:39 +02:00
// import classes
import { Objectmap } from '@pushrocks/lik';
2018-03-15 02:29:40 +01:00
import { SocketFunction } from './smartsocket.classes.socketfunction';
2016-08-08 18:20:00 +02:00
2016-08-07 14:58:20 +02:00
/**
2016-08-07 15:37:52 +02:00
* interface for class SocketRole
2016-08-07 14:58:20 +02:00
*/
2016-08-07 15:37:52 +02:00
export interface SocketRoleOptions {
2018-03-15 02:29:40 +01:00
name: string;
passwordHash: string;
2016-08-07 15:37:52 +02:00
}
/**
* A socketrole defines access to certain routines.
*/
export class SocketRole {
2018-03-15 02:29:40 +01:00
name: string;
passwordHash: string;
allowedFunctions = new Objectmap<SocketFunction>();
constructor(optionsArg: SocketRoleOptions) {
this.name = optionsArg.name;
this.passwordHash = optionsArg.passwordHash;
}
addSocketFunction(socketFunctionArg: SocketFunction) {
this.allowedFunctions.add(socketFunctionArg);
}
}