Change Accountstatus to a bool
This commit is contained in:
@@ -17,13 +17,6 @@ class AccountType(Enum):
|
|||||||
"User accounts are used to allow agents to log in and perform actions"
|
"User accounts are used to allow agents to log in and perform actions"
|
||||||
|
|
||||||
|
|
||||||
class AccountStatus(Enum):
|
|
||||||
"""Whether the account is active."""
|
|
||||||
|
|
||||||
ENABLED = 1
|
|
||||||
DISABLED = 2
|
|
||||||
|
|
||||||
|
|
||||||
class PasswordPolicyLevel(Enum):
|
class PasswordPolicyLevel(Enum):
|
||||||
"""Complexity requirements for account passwords."""
|
"""Complexity requirements for account passwords."""
|
||||||
|
|
||||||
@@ -47,7 +40,7 @@ class Account(SimComponent):
|
|||||||
"Account password."
|
"Account password."
|
||||||
account_type: AccountType
|
account_type: AccountType
|
||||||
"Account Type, currently this can be service account (used by apps) or user account."
|
"Account Type, currently this can be service account (used by apps) or user account."
|
||||||
status: AccountStatus = AccountStatus.DISABLED
|
enabled: bool = True
|
||||||
|
|
||||||
def describe_state(self) -> Dict:
|
def describe_state(self) -> Dict:
|
||||||
"""Describe state for agent observations."""
|
"""Describe state for agent observations."""
|
||||||
@@ -55,11 +48,11 @@ class Account(SimComponent):
|
|||||||
|
|
||||||
def enable(self):
|
def enable(self):
|
||||||
"""Set the status to enabled."""
|
"""Set the status to enabled."""
|
||||||
self.status = AccountStatus.ENABLED
|
self.enabled = True
|
||||||
|
|
||||||
def disable(self):
|
def disable(self):
|
||||||
"""Set the status to disabled."""
|
"""Set the status to disabled."""
|
||||||
self.status = AccountStatus.DISABLED
|
self.enabled = False
|
||||||
|
|
||||||
def log_on(self) -> None:
|
def log_on(self) -> None:
|
||||||
"""TODO."""
|
"""TODO."""
|
||||||
|
|||||||
Reference in New Issue
Block a user