GM6000 Digital Heater Controller Branch: main
SDX-1330
SecurityNull.h
Go to the documentation of this file.
1#ifndef Cpl_TShell_SecurityNull_h_
2#define Cpl_TShell_SecurityNull_h_
3/*-----------------------------------------------------------------------------
4* This file is part of the Colony.Core Project. The Colony.Core Project is an
5* open source project with a BSD type of licensing agreement. See the license
6* agreement (license.txt) in the top/ directory or on the Internet at
7* http://integerfox.com/colony.core/license.txt
8*
9* Copyright (c) 2014-2022 John T. Taylor
10*
11* Redistributions of the source code must retain the above copyright notice.
12*----------------------------------------------------------------------------*/
13/** @file */
14
15#include "Cpl/TShell/Security.h"
16#include <string.h>
17
18///
19namespace Cpl {
20///
21namespace TShell {
22
23/** This concrete class dummy/null implementation of the Security interface
24 */
25
26class SecurityNull : public Security
27{
28public:
29 /// Constructor
31
32public:
33 /// See Cpl::TShell::Security
34 Permission_T validateCredentials( const char* username, const char* password ) noexcept
35 {
36 if ( strcmp( username, "user" ) == 0 )
37 {
38 return eUSER;
39 }
40 if ( strcmp( username, "system" ) == 0 )
41 {
42 return eSYSTEM;
43 }
44 if ( strcmp( username, "admin" ) == 0 )
45 {
46 return eADMIN;
47 }
48 return ePUBLIC;
49 }
50};
51
52
53} // end namespaces
54}
55#endif // end header latch
This abstract defines the interface for validating a 'user login' for TShell.
Definition Security.h:31
Permission_T
Permissions levels.
Definition Security.h:34
@ eADMIN
Highest permission setting, i.e.
Definition Security.h:38
@ ePUBLIC
No permissions, i.e.
Definition Security.h:35
@ eSYSTEM
Higher permission setting, i.e.
Definition Security.h:37
@ eUSER
Lowest permission setting, i.e.
Definition Security.h:36
This concrete class dummy/null implementation of the Security interface.
Definition SecurityNull.h:27
SecurityNull()
Constructor.
Definition SecurityNull.h:30
Permission_T validateCredentials(const char *username, const char *password) noexcept
See Cpl::TShell::Security.
Definition SecurityNull.h:34
The 'Cpl' namespace is the root name space for the Colony.
Definition Api16.h:20