add time-based access restrictions

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2024-03-17 11:30:03 +01:00
parent 74dd2a3b9a
commit cc9a0d4dc2
17 changed files with 417 additions and 15 deletions

View File

@@ -109,6 +109,14 @@ func (c *BaseConnection) GetMaxSessions() int {
return c.User.MaxSessions
}
// isAccessAllowed returns true if the user's access conditions are met
func (c *BaseConnection) isAccessAllowed() bool {
if err := c.User.CheckLoginConditions(); err != nil {
return false
}
return true
}
// GetProtocol returns the protocol for the connection
func (c *BaseConnection) GetProtocol() string {
return c.protocol