diff --git a/doc/LowLevel/UserManagement/UserManagement.CreateAccount.png b/doc/LowLevel/UserManagement/UserManagement.CreateAccount.png deleted file mode 100644 index 59f6ae3..0000000 Binary files a/doc/LowLevel/UserManagement/UserManagement.CreateAccount.png and /dev/null differ diff --git a/doc/LowLevel/UserManagement/UserManagement.DeleteUser.png b/doc/LowLevel/UserManagement/UserManagement.DeleteUser.png deleted file mode 100644 index 65a0ff1..0000000 Binary files a/doc/LowLevel/UserManagement/UserManagement.DeleteUser.png and /dev/null differ diff --git a/doc/LowLevel/UserManagement/UserManagement.DisableUser.png b/doc/LowLevel/UserManagement/UserManagement.DisableUser.png deleted file mode 100644 index cea8883..0000000 Binary files a/doc/LowLevel/UserManagement/UserManagement.DisableUser.png and /dev/null differ diff --git a/doc/LowLevel/UserManagement/UserManagement.EditUserRecords.png b/doc/LowLevel/UserManagement/UserManagement.EditUserRecords.png deleted file mode 100644 index 4be1359..0000000 Binary files a/doc/LowLevel/UserManagement/UserManagement.EditUserRecords.png and /dev/null differ diff --git a/doc/LowLevel/UserManagement/UserManagement.EnableUser.png b/doc/LowLevel/UserManagement/UserManagement.EnableUser.png deleted file mode 100644 index ccfa2fb..0000000 Binary files a/doc/LowLevel/UserManagement/UserManagement.EnableUser.png and /dev/null differ diff --git a/doc/LowLevel/UserManagement/UserManagementCreateAccount.txt b/doc/LowLevel/UserManagement/UserManagementCreateAccount.txt deleted file mode 100644 index be31f4c..0000000 --- a/doc/LowLevel/UserManagement/UserManagementCreateAccount.txt +++ /dev/null @@ -1,173 +0,0 @@ -title Create User Record -actor User -participant Controller.cs #90EE90 -participant RDSFactory #26abff -participant UserAccount #CBC3E3 -participant SystemAccountManager #ffffe0 -participant AccountService #ff8b3d -participant SqlDAO #D3D3D3 -//SqlDAO -database SqlServer(MariaDB) #00FFFF - -//activate User -activate Controller.cs #90EE90 -User->Controller.cs: ++Create new User++ - -//RelatDSFactory -Controller.cs->RDSFactory:++factory = new RDSFactory()++ -activate RDSFactory #26abff -RDSFactory->RDSFactory:++Constructor()++ -Controller.cs<--RDSFactory:++return RDSFactory++ -deactivate RDSFactory -Controller.cs->SqlDAO:++IDataSource factory.GetDataSource(string DbName, string connInfo)++ -activate SqlDAO #D3D3D3 -SqlDAO->SqlDAO:++Constructor(string connInfo)++ -group #red Data Store Timed Out #white -SqlDAO->SqlDAO:++Catch Exception++ -Controller.cs<--SqlDAO:++return "Data Source Timed Out"++ -end -group #blue Data Store Online #white -Controller.cs<--SqlDAO: ++return SqlDAO++ -deactivate SqlDAO - - -// Create new Admin -Controller.cs->SystemAccountManager:++ manager = new SystemAccountManager(IDataSource conn)++ -activate SystemAccountManager #ffffe0 -SystemAccountManager->SystemAccountManager:++Constructor(IDataSource conn)++ -Controller.cs<--SystemAccountManager:++ New SystemAccountManager++ -deactivate SystemAccountManager - -// GetUserName -Controller.cs->Controller.cs:++string GetUserName()++ - -// GetPassword -Controller.cs->Controller.cs:++string GetPassword()++ -// -Controller.cs->UserAccount:++ new UserAccount(string username,\n string password,\n DateTime TimeStamp)++ -activate UserAccount #CBC3E3 -UserAccount->UserAccount:++Constructor(string username,\n string password,\n DateTime TimeStamp)++ -Controller.cs<--UserAccount:++New UserAccount++ -deactivate UserAccount - -activate SystemAccountManager #ffffe0 -SystemAccountManager->SystemAccountManager:++isInputValid(user: UserAccount)++ - -group #red Invalid Information #white -Controller.cs<--SystemAccountManager:++return "Invalid input"++ -User<--Controller.cs:++ return "Invalid input"++ -end -Controller.cs<--SystemAccountManager:++return true++ -deactivate SystemAccountManager -// -Controller.cs->SystemAccountManager:++manager.CreateUserRecord(user:UserAccount)++ - -//check if there is an admin user -activate SystemAccountManager #ffffe0 -SystemAccountManager->SqlDAO:++bool isAdmin(user:UserAccount)++ -activate SqlDAO #D3D3D3 -SqlDAO->SqlServer(MariaDB):++SqlRead confirmAdmin()++ -activate SqlServer(MariaDB)#00FFFF -//authorized -SqlServer(MariaDB)->SqlServer(MariaDB):++Select * from Admins\n where Username = @UserName \nand Password = @Pwd++ -//Unauthorized role section -group #red Unauthorized User #white -SqlDAO<--SqlServer(MariaDB):++SqlException++ -SqlDAO->SqlDAO: ++Catch\nSqlException++ -SystemAccountManager<--SqlDAO:++return false++ -Controller.cs<--SystemAccountManager:++ return "Access Denied: \nUnauthorized"++ -User<--Controller.cs:++return "Access Denied: \nUnauthorized"++ -end -//Unauthorized role section -group #red Unauthorized User #white -SqlDAO<--SqlServer(MariaDB):++return false++ -SystemAccountManager<--SqlDAO:++return false++ -Controller.cs<--SystemAccountManager:++ return "Access Denied: \nUnauthorized"++ -User<--Controller.cs:++return "Access Denied: \nUnauthorized"++ -end - - -//Authorized role section -group #blue Authorized User #white -SqlDAO<--SqlServer(MariaDB):++return true++ -deactivate SqlServer(MariaDB) -SystemAccountManager<--SqlDAO:++return true++ -deactivate SqlDAO -deactivate SystemAccountManager - -group #green Valid Information #white -activate SystemAccountManager #ffffe0 -// GetUserName -SystemAccountManager->SystemAccountManager:++string NewUserName()++ -// Enter UserName -User->SystemAccountManager:++string NewUserName++ -// GetPassword -SystemAccountManager->SystemAccountManager:++string NewPassword()++ -// Enter Password -User->SystemAccountManager:++string NewPassword++ -// GetEmail -SystemAccountManager->SystemAccountManager:++string NewEmail()++ -// Enter Email -User->SystemAccountManager:++string NewEmail++ -// GetRole -SystemAccountManager->SystemAccountManager:++string NewRole()++ -// Enter Role -User->SystemAccountManager:++string NewRole++ -// Create NewUser object -UserAccount<-SystemAccountManager:++new NewUser(\nstring NewUserName,\nstring NewPassword,\nstring New Email,\nstring NewRole,\nDateTime TimeStamp)++ -activate UserAccount #CBC3E3 -UserAccount->UserAccount:++Constructor(\nstring NewUserName,\nstring NewPassword,\nstring New Email,\nstring NewRole,\nDateTime TimeStamp)++ -UserAccount-->SystemAccountManager:++return NewUser++ -deactivate UserAccount -//Create User Record -SystemAccountManager->AccountService:++AccountService\n.CreateUserRecord(user:NewUser)++ -activate AccountService #ff8b3d -AccountService->SqlDAO:++SqlDAO\n.CreateUserRecord(user:NewUser)++ -activate SqlDAO #D3D3D3 -SqlDAO->SqlServer(MariaDB):++SqlRead \nisUser(user:NewUser)++ -activate SqlServer(MariaDB) #00FFFF -SqlServer(MariaDB)->SqlServer(MariaDB):++ Select *\nFrom Users\nwhere Username\n= @UserName OR\nemail = @Email++ -group #red data store timed out #white -SqlDAO<--SqlServer(MariaDB):++SqlException++ -deactivate SqlServer(MariaDB) -SqlDAO->SqlDAO: ++Catch\nSqlException++ -AccountService<--SqlDAO:++return "Database timed out"++ - -SystemAccountManager<--AccountService:++ return "Database timed out"++ -Controller.cs<--SystemAccountManager:++ return "Database timed out"++ -User<--Controller.cs:++ return "Database timed out"++ -end -group #blue data store is online #white -// User exists -group #green User does exist #white -activate SqlServer(MariaDB) #00FFFF -SqlDAO<--SqlServer(MariaDB):++ return True++ -deactivate SqlServer(MariaDB) -AccountService<--SqlDAO:++return "User is already registered"++ -SystemAccountManager<--AccountService:++return "User is already registered"++ -Controller.cs<--SystemAccountManager:++return "User is already registered"++ -User<--Controller.cs:++ return \n"User is already registered"++ - -end -// User doesn't exist -group #green User does not exist #white -activate SqlServer(MariaDB) #00FFFF -SqlDAO<--SqlServer(MariaDB):++ return False++ -SqlDAO->SqlServer(MariaDB):++ SQL insert\nuser credentials++ -SqlDAO<--SqlServer(MariaDB):++ return 1++ -deactivate SqlServer(MariaDB) -AccountService<--SqlDAO:++return "User is now registered"++ -deactivate SqlDAO -SystemAccountManager<--AccountService:++return "User is now registered"++ -deactivate AccountService -Controller.cs<--SystemAccountManager:++return "User is now registered"++ -deactivate SystemAccountManager -User<--Controller.cs:++ return \n"User is now registered"++ - -deactivate Controller.cs -end -//deactivate User -end -end -end -end diff --git a/doc/LowLevel/UserManagement/UserManagementDeleteUser.txt b/doc/LowLevel/UserManagement/UserManagementDeleteUser.txt deleted file mode 100644 index 4d57538..0000000 --- a/doc/LowLevel/UserManagement/UserManagementDeleteUser.txt +++ /dev/null @@ -1,164 +0,0 @@ -title Delete User Record -actor User -participant Controller.cs #90EE90 -participant RDSFactory #26abff -participant UserAccount #CBC3E3 -participant SystemAccountManager #ffffe0 -participant AccountService #ff8b3d -participant SqlDAO #D3D3D3 -//SqlDAO -database SqlServer(MariaDB) #00FFFF - -//activate User -activate Controller.cs #90EE90 -User->Controller.cs: ++Request to delete user++ - -//RelatDSFactory -Controller.cs->RDSFactory:++factory = new RDSFactory()++ -activate RDSFactory #26abff -RDSFactory->RDSFactory:++Constructor()++ -Controller.cs<--RDSFactory:++return RDSFactory++ -deactivate RDSFactory -Controller.cs->SqlDAO:++IDataSource factory.GetDataSource(string DbName, string connInfo)++ -activate SqlDAO #D3D3D3 -SqlDAO->SqlDAO:++Constructor(string connInfo)++ -group #red Data Store Timed Out #white -SqlDAO->SqlDAO: ++Catch SqlException++ -Controller.cs<--SqlDAO:++return "Data Source Timed Out"++ -end -group #blue Data Store Online #white -Controller.cs<--SqlDAO: ++return SqlDAO++ -deactivate SqlDAO - -// Create new Admin -Controller.cs->SystemAccountManager:++ manager = new SystemAccountManager(IDataSource conn)++ -activate SystemAccountManager #ffffe0 -SystemAccountManager->SystemAccountManager:++Constructor(IDataSource conn)++ -Controller.cs<--SystemAccountManager:++ New SystemAccountManager++ -deactivate SystemAccountManager - -// GetUserName -Controller.cs->Controller.cs:++string GetUserName()++ - -// GetPassword -Controller.cs->Controller.cs:++string GetPassword()++ - -// -Controller.cs->UserAccount:++ new UserAccount(string username,\n string password\n DateTime RegistrationTimeStamp)++ -activate UserAccount #CBC3E3 -UserAccount->UserAccount: ++Constructor(string username,\n string password,\n DateTime RegistrationTimeStamp)++ -Controller.cs<--UserAccount:++New UserAccount++ -deactivate UserAccount - -activate SystemAccountManager #ffffe0 -SystemAccountManager->SystemAccountManager:++isInputValid(user: UserAccount)++ -group #red Invalid Information #white -Controller.cs<--SystemAccountManager:++return "Invalid input"++ -User<--Controller.cs:++ return "Invalid input"++ -end -Controller.cs<--SystemAccountManager:++return true++ -deactivate SystemAccountManager - -// -Controller.cs->SystemAccountManager: ++manager.DeleteUserRecord(user:UserAccount)++ - -//check if there is an admin user -activate SystemAccountManager #ffffe0 -SystemAccountManager->SqlDAO:++isAdmin(user:UserAccount)++ -activate SqlDAO #D3D3D3 -SqlDAO->SqlServer(MariaDB):++SqlRead confirmAdmin()++ -activate SqlServer(MariaDB)#00FFFF -SqlServer(MariaDB)->SqlServer(MariaDB):++Select * from Admins\n where Username = @UserName \nand Password = @Pwd++ -//Unauthorized role section -group #red Unauthorized User #white -SqlDAO<--SqlServer(MariaDB):++SqlException++ -SqlDAO->SqlDAO: ++Catch\nSqlException++ -SystemAccountManager<--SqlDAO:++return false++ -Controller.cs<--SystemAccountManager:++ return "Access Denied: \nUnauthorized"++ -User<--Controller.cs:++return "Access Denied: \nUnauthorized"++ -end -//Unauthorized role section -group #red Unauthorized User #white -SqlDAO<--SqlServer(MariaDB):++return false++ -SystemAccountManager<--SqlDAO:++return false++ -Controller.cs<--SystemAccountManager:++ return "Access Denied: \nUnauthorized"++ -User<--Controller.cs:++return "Access Denied: \nUnauthorized"++ -end - - -//Authorized role section -group #blue Authorized User #white -SqlDAO<--SqlServer(MariaDB):++return true++ -deactivate SqlServer(MariaDB) -SystemAccountManager<--SqlDAO:++return true++ -deactivate SqlDAO -deactivate SystemAccountManager -group #green Valid Information #white -activate SystemAccountManager #ffffe0 -// GetUserName -SystemAccountManager->SystemAccountManager:++string NewUserName()++ -// Enter UserName -User->SystemAccountManager:++string NewUserName++ -// GetPassword -SystemAccountManager->SystemAccountManager:++string NewPassword()++ -// Enter Password -User->SystemAccountManager:++string NewPassword++ -// GetRole -SystemAccountManager->SystemAccountManager:++string NewRole()++ -// Enter Role -User->SystemAccountManager:++string NewRole++ -// Create NewUser object -UserAccount<-SystemAccountManager:++new NewUser(\nstring NewUserName,\nstring NewPassword,\nstring role,\nDateTime TimeStamp)++ -activate UserAccount #CBC3E3 -UserAccount->UserAccount:++Constructor(\nstring NewUserName,\nstring NewPassword,\nstring role,\nDateTime TimeStamp)++ -UserAccount-->SystemAccountManager:++return NewUser++ -deactivate UserAccount -SystemAccountManager->AccountService:++AccountService\n.DeleteUserRecord(user:NewUser,\nUpdateType: userDelete)++ -activate AccountService #ff8b3d -AccountService->SqlDAO:++SqlDAO\n.DeleteUserRecord(user:NewUser,\nUpdateType: userDelete)++ -activate SqlDAO #D3D3D3 -SqlDAO->SqlServer(MariaDB):++isUser(user:NewUser)++ -activate SqlServer(MariaDB) #00FFFF -SqlServer(MariaDB)->SqlServer(MariaDB):++Select *\nFrom Users\nwhere Username\n= @UserName and\nRole = @UserRole -group #red data store timed out #white -SqlDAO<--SqlServer(MariaDB):++SqlException++ -deactivate SqlServer(MariaDB) -SqlDAO->SqlDAO: ++Catch\nSqlException++ -AccountService<--SqlDAO:++return "Database timed out"++ - -SystemAccountManager<--AccountService:++ return "Database timed out"++ -Controller.cs<--SystemAccountManager:++ return "Database timed out"++ -User<--Controller.cs:++ return "Database timed out"++ -end -group #blue data store is online #white -// User exists -group #green User does exist #white -activate SqlServer(MariaDB) #00FFFF -SqlDAO<--SqlServer(MariaDB):++ return True++ -SqlDAO->SqlServer(MariaDB):++Delete from users\nwhere Username = @UserName \nand Password = @PWD++ -SqlDAO<--SqlServer(MariaDB):++ return 1++ -AccountService<--SqlDAO:++return "User deleted successfully"++ -SystemAccountManager<--AccountService:++return "User deleted successfully"++ -Controller.cs<--SystemAccountManager:++return "User deleted successfully"++ -User<--Controller.cs:++ return \n"User deleted successfully"++ -deactivate SqlServer(MariaDB) -end -// User doesn't exist -group #red User does not exist #white -activate SqlServer(MariaDB) #00FFFF -SqlDAO<--SqlServer(MariaDB):++ return False++ -AccountService<--SqlDAO:++return "User does not exist"++ -SystemAccountManager<--AccountService:++return "User does not exist"++ -Controller.cs<--SystemAccountManager:++return "User does not exist"++ -User<--Controller.cs:++ return \n"User does not exist"++ -deactivate AccountService -deactivate SqlDAO -deactivate SqlServer(MariaDB) -deactivate SystemAccountManager -deactivate Controller.cs -end -//deactivate User -end -end -end -end \ No newline at end of file diff --git a/doc/LowLevel/UserManagement/UserManagementDisableUser.txt b/doc/LowLevel/UserManagement/UserManagementDisableUser.txt deleted file mode 100644 index a9cd10e..0000000 --- a/doc/LowLevel/UserManagement/UserManagementDisableUser.txt +++ /dev/null @@ -1,161 +0,0 @@ -title Disable Specfied User -actor User -participant Controller.cs #90EE90 -participant RDSFactory #26abff -participant UserAccount #CBC3E3 -participant SystemAccountManager #ffffe0 -participant AccountService #ff8b3d -participant SqlDAO #D3D3D3 -//SqlDAO -database SqlServer(MariaDB) #00FFFF - -//activate User -activate Controller.cs #90EE90 -User->Controller.cs: ++Request to disable user\n by a different user++ - -//RelatDSFactory -Controller.cs->RDSFactory:++factory = new RDSFactory()++ -activate RDSFactory #26abff -RDSFactory->RDSFactory:++Constructor()++ -Controller.cs<--RDSFactory:++return RDSFactory++ -deactivate RDSFactory -Controller.cs->SqlDAO:++IDataSource factory.GetDataSource(string DbName, string connInfo)++ -activate SqlDAO #D3D3D3 -SqlDAO->SqlDAO:++Constructor(string connInfo)++ -group #red Data Store Timed Out #white -SqlDAO->SqlDAO: ++Catch SqlException++ -Controller.cs<--SqlDAO:++return "Data Source Timed Out"++ -end -group #blue Data Store Online #white -Controller.cs<--SqlDAO: ++return SqlDAO++ -deactivate SqlDAO - -// Create new Admin -Controller.cs->SystemAccountManager:++ manager = new SystemAccountManager(IDataSource conn)++ -activate SystemAccountManager #ffffe0 -SystemAccountManager->SystemAccountManager:++Constructor(IDataSource conn)++ -Controller.cs<--SystemAccountManager:++ New SystemAccountManager++ -deactivate SystemAccountManager - -// GetUserName -Controller.cs->Controller.cs:++string GetUserName()++ - -// GetPassword -Controller.cs->Controller.cs:++string GetPassword()++ - -// Pass object -Controller.cs->UserAccount:++ new UserAccount(string username,\n string password\n DateTime RegistrationTimeStamp)++ -activate UserAccount #CBC3E3 -UserAccount->UserAccount: ++Constructor(string username,\n string password,\n DateTime RegistrationTimeStamp)++ -Controller.cs<--UserAccount:++New UserAccount++ -deactivate UserAccount - -activate SystemAccountManager #ffffe0 -SystemAccountManager->SystemAccountManager:++isInputValid(user: UserAccount)++ -group #red Invalid Information #white -Controller.cs<--SystemAccountManager:++return "Invalid input"++ -User<--Controller.cs:++ return "Invalid input"++ -end -Controller.cs<--SystemAccountManager:++return true++ -deactivate SystemAccountManager - -// -Controller.cs->SystemAccountManager: ++manager.DisableUserRecord(user:UserAccount)++ - -//check if there is an admin user -activate SystemAccountManager #ffffe0 -SystemAccountManager->SqlDAO:++isAdmin(user:UserAccount)++ -activate SqlDAO #D3D3D3 -SqlDAO->SqlServer(MariaDB):++SqlRead confirmAdmin()++ -activate SqlServer(MariaDB)#00FFFF -SqlServer(MariaDB)->SqlServer(MariaDB):++Select * from Admins\n where Username = @UserName \nand Password = @Pwd++ -//Unauthorized role section -group #red Unauthorized User #white -SqlDAO<--SqlServer(MariaDB):++SqlException++ -SqlDAO->SqlDAO: ++Catch\nSqlException++ -SystemAccountManager<--SqlDAO:++return false++ -Controller.cs<--SystemAccountManager:++ return "Access Denied: \nUnauthorized"++ -User<--Controller.cs:++return "Access Denied: \nUnauthorized"++ -//Unauthorized role section -end -group #red Unauthorized User #white -SqlDAO<--SqlServer(MariaDB):++return false++ -SystemAccountManager<--SqlDAO:++return false++ -Controller.cs<--SystemAccountManager:++ return "Access Denied: \nUnauthorized"++ -User<--Controller.cs:++return "Access Denied: \nUnauthorized"++ -end - - -//Authorized role section -group #blue Authorized User #white -SqlDAO<--SqlServer(MariaDB):++return true++ -deactivate SqlServer(MariaDB) -SystemAccountManager<--SqlDAO:++return true++ -deactivate SqlDAO -deactivate SystemAccountManager - -group #green Valid Information #white -activate SystemAccountManager #ffffe0 -// GetUserName -SystemAccountManager->SystemAccountManager:++string NewUserName()++ -// Enter UserName -User->SystemAccountManager:++string NewUserName++ -// GetRole -SystemAccountManager->SystemAccountManager:++string NewRole()++ -// Enter Role -User->SystemAccountManager:++string NewRole++ -// Create NewUser object -UserAccount<-SystemAccountManager:++new NewUser(\nstring NewUserName,\nstring role,\nDateTime TimeStamp)++ -activate UserAccount #CBC3E3 -UserAccount->UserAccount:++Constructor(\nstring NewUserName,\nstring role,\nDateTime TimeStamp)++ -UserAccount-->SystemAccountManager:++return NewUser++ -deactivate UserAccount -SystemAccountManager->AccountService:++AccountService\n.DisableUserRecord(user:NewUser,\nUpdateType:userDisable)++ -activate AccountService #ff8b3d -AccountService->SqlDAO:++SqlDAO\n.DisableUser(user:NewUser,\nUpdateType:userDisable)++ -activate SqlDAO #D3D3D3 -SqlDAO->SqlServer(MariaDB):++isUser(user:NewUser)++ -activate SqlServer(MariaDB) #00FFFF -SqlServer(MariaDB)->SqlServer(MariaDB):++ Select *\nFrom Users\nwhere Username\n= @UserName and\nRole = @UserRole\n -group #red data store timed out #white -SqlDAO<--SqlServer(MariaDB):++SqlException++ -deactivate SqlServer(MariaDB) -SqlDAO->SqlDAO: ++Catch\nSqlException++ -AccountService<--SqlDAO:++return "Database timed out"++ - -SystemAccountManager<--AccountService:++ return "Database timed out"++ -Controller.cs<--SystemAccountManager:++ return "Database timed out"++ -User<--Controller.cs:++ return "Database timed out"++ -end -group #blue data store is online #white -// User exists -group #green User does exist #white -activate SqlServer(MariaDB) #00FFFF -SqlDAO<--SqlServer(MariaDB):++ return True++ -SqlDAO->SqlServer(MariaDB):++Update users Set isActive = 0\nwhere UserName = @UserName++ -SqlDAO<--SqlServer(MariaDB):++ return 1++ -deactivate SqlServer(MariaDB) -AccountService<--SqlDAO:++return "User is now disabled"++ -SystemAccountManager<--AccountService:++return "User is now disabled"++ -Controller.cs<--SystemAccountManager:++return "User is now disabled"++ -User<--Controller.cs:++ return \n"User is now disabled"++ -end -// User doesn't exist -group #red User does not exist #white -activate SqlServer(MariaDB) #00FFFF -SqlDAO<--SqlServer(MariaDB):++ return False++ -deactivate SqlServer(MariaDB) -AccountService<--SqlDAO:++return "User does not exist"++ -deactivate SqlDAO -SystemAccountManager<--AccountService:++return "User does not exist"++ -deactivate AccountService -Controller.cs<--SystemAccountManager:++return "User does not exist"++ -deactivate SystemAccountManager -User<--Controller.cs:++ return \n"User does not exist"++ -deactivate Controller.cs -end -//deactivate User -end -end -end -end \ No newline at end of file diff --git a/doc/LowLevel/UserManagement/UserManagementEditUserRecords.txt b/doc/LowLevel/UserManagement/UserManagementEditUserRecords.txt deleted file mode 100644 index d35b4e9..0000000 --- a/doc/LowLevel/UserManagement/UserManagementEditUserRecords.txt +++ /dev/null @@ -1,171 +0,0 @@ -title Edit User Record -actor User -participant Controller.cs #90EE90 -participant RDSFactory #26abff -participant UserAccount #CBC3E3 -participant SystemAccountManager #ffffe0 -participant AccountService #ff8b3d -participant SqlDAO #D3D3D3 -//SqlDAO -database SqlServer(MariaDB) #00FFFF - -//activate User -activate Controller.cs #90EE90 -User->Controller.cs: ++Request to edit user\nby a different user++ - -//RelatDSFactory -Controller.cs->RDSFactory:++factory = new RDSFactory()++ -activate RDSFactory #26abff -RDSFactory->RDSFactory:++Constructor()++ -Controller.cs<--RDSFactory:++return RDSFactory++ -deactivate RDSFactory -Controller.cs->SqlDAO:++IDataSource factory.GetDataSource(string DbName, string connInfo)++ -activate SqlDAO #D3D3D3 -SqlDAO->SqlDAO:++Constructor(string connInfo)++ -group #red Data Store Timed Out #white -SqlDAO->SqlDAO: ++Catch Exception++ -Controller.cs<--SqlDAO:++return "Data Source Timed Out"++ -end -group #blue Data Store Online #white -Controller.cs<--SqlDAO: ++return SqlDAO++ -deactivate SqlDAO - -// Create new Admin -Controller.cs->SystemAccountManager:++ manager = new SystemAccountManager(IDataSource conn)++ -activate SystemAccountManager #ffffe0 -SystemAccountManager->SystemAccountManager:++Constructor(IDataSource conn)++ -Controller.cs<--SystemAccountManager:++ New SystemAccountManager++ -deactivate SystemAccountManager - -// GetUserName -Controller.cs->Controller.cs:++string GetUserName()++ - -// GetPassword -Controller.cs->Controller.cs:++string GetPassword()++ - -// - -Controller.cs->UserAccount:++ new UserAccount(string username,\n string password,\n DateTime RegistrationTimeStamp)++ -activate UserAccount #CBC3E3 -UserAccount->UserAccount: ++string username,\n string password,\n DateTime RegistrationTimeStamp++ -Controller.cs<--UserAccount:++New UserAccount++ -deactivate UserAccount -activate SystemAccountManager #ffffe0 -SystemAccountManager->SystemAccountManager:++isInputValid(user: UserAccount)++ -group #red Invalid Information #white -Controller.cs<--SystemAccountManager:++return "Invalid input"++ -User<--Controller.cs:++ return "Invalid input"++ -end -Controller.cs<--SystemAccountManager:++return true++ -deactivate SystemAccountManager - -//look over -Controller.cs->SystemAccountManager:++manager.UpdateUserRecord(user:UserAccount)++ - -//check if there is an admin user -activate SystemAccountManager #ffffe0 -SystemAccountManager->SqlDAO:++bool isAdmin(user:UserAccount)++ -activate SqlDAO #D3D3D3 -SqlDAO->SqlServer(MariaDB):++SqlRead confirmAdmin()++ -activate SqlServer(MariaDB)#00FFFF -//authorized -SqlServer(MariaDB)->SqlServer(MariaDB):++Select * from Admins\n where Username = @UserName \nand Password = @Pwd++ -//Unauthorized role section -group #red Unauthorized User #white -SqlDAO<--SqlServer(MariaDB):++SqlException++ -SqlDAO->SqlDAO: ++Catch\nSqlException++ -SystemAccountManager<--SqlDAO:++return false++ -Controller.cs<--SystemAccountManager:++ return "Access Denied: \nUnauthorized"++ -User<--Controller.cs:++return "Access Denied: \nUnauthorized"++ -end -//Unauthorized role section -group #red Unauthorized User #white -SqlDAO<--SqlServer(MariaDB):++return false++ -SystemAccountManager<--SqlDAO:++return false++ -Controller.cs<--SystemAccountManager:++ return "Access Denied: \nUnauthorized"++ -User<--Controller.cs:++return "Access Denied: \nUnauthorized"++ -end - - -//Authorized role section -group #blue Authorized User #white -SqlDAO<--SqlServer(MariaDB):++return true++ -deactivate SqlServer(MariaDB) -SystemAccountManager<--SqlDAO:++return true++ -deactivate SqlDAO -deactivate SystemAccountManager -group #green Valid Information #white -activate SystemAccountManager #ffffe0 -// GetUserName -SystemAccountManager->SystemAccountManager:++string NewUserName()++ -// Enter UserName -User->SystemAccountManager:++string NewUserName++ -// GetPassword -SystemAccountManager->SystemAccountManager:++string NewPassword()++ -// Enter Password -User->SystemAccountManager:++string NewPassword++ -// GetEmail -SystemAccountManager->SystemAccountManager:++string NewEmail()++ -// Enter Email -User->SystemAccountManager:++string NewEmail++ -// GetRole -SystemAccountManager->SystemAccountManager:++string NewRole()++ -// Enter Role -User->SystemAccountManager:++string NewRole++ -// Create NewUser object -UserAccount<-SystemAccountManager:++new NewUser(\nstring NewUserName,\nstring NewPassword,\nstring New Email,\nstring NewRole,\nDateTime TimeStamp)++ -activate UserAccount #CBC3E3 -UserAccount->UserAccount:++Constructor(\nstring NewUserName,\nstring NewPassword,\nstring New Email,\nstring NewRole,\nDateTime TimeStamp)++ -UserAccount-->SystemAccountManager:++return NewUser++ -deactivate UserAccount -SystemAccountManager->AccountService:++AccountService\n.UpdateUserRecord(user:NewUser,\nUpdateType: userUpdate)++ -activate AccountService #ff8b3d -AccountService->SqlDAO:++SqlDAO\n.UpdateUserRecord(user:NewUser,\nUpdateType: userUpdate)++ -activate SqlDAO #D3D3D3 -SqlDAO->SqlServer(MariaDB):++isUser(user:NewUser)++ -activate SqlServer(MariaDB) #00FFFF -SqlServer(MariaDB)->SqlServer(MariaDB):++Update *\nFrom Users\nwhere Username\n= @UserName and\nRole = @UserRole -group #red data store timed out #white -SqlDAO<--SqlServer(MariaDB):++SqlException++ -deactivate SqlServer(MariaDB) -SqlDAO->SqlDAO: ++Catch\nSqlException++ -AccountService<--SqlDAO:++return "Database timed out"++ - -SystemAccountManager<--AccountService:++ return "Database timed out"++ -Controller.cs<--SystemAccountManager:++ return "Database timed out"++ -User<--Controller.cs:++ return "Database timed out"++ -end -group #blue data store is online #white -// User exists -group #green User does exist #white -activate SqlServer(MariaDB) #00FFFF -SqlDAO<--SqlServer(MariaDB):++ return True++ -SqlDAO->SqlServer(MariaDB):++ SQL insert\nupdate credentials++ -SqlDAO<--SqlServer(MariaDB):++ return 1++ -deactivate SqlServer(MariaDB) -AccountService<--SqlDAO:++return "User information updated successfully"++ -SystemAccountManager<--AccountService:++return "User information updated successfully"++ -Controller.cs<--SystemAccountManager:++return "User information updated successfully"++ -User<--Controller.cs:++ return "User information\n updated successfully"++ -end -// User doesn't exist -group #green User does not exist #white -activate SqlServer(MariaDB) #00FFFF -SqlDAO<--SqlServer(MariaDB):++ return False++ -SqlDAO->SqlServer(MariaDB):++ SQL insert\nuser credentials++ -SqlDAO<--SqlServer(MariaDB):++ return 1++ -deactivate SqlServer(MariaDB) -AccountService<--SqlDAO:++return "User is now registered"++ -deactivate SqlDAO -SystemAccountManager<--AccountService:++return "User is now registered"++ -deactivate AccountService -Controller.cs<--SystemAccountManager:++return "User is now registered"++ -deactivate SystemAccountManager -User<--Controller.cs:++ return \n"User is now registered"++ -deactivate Controller.cs -end -//deactivate User -end -end -end -end \ No newline at end of file diff --git a/doc/LowLevel/UserManagement/UserManagementEnableUser.txt b/doc/LowLevel/UserManagement/UserManagementEnableUser.txt deleted file mode 100644 index 71b32f4..0000000 --- a/doc/LowLevel/UserManagement/UserManagementEnableUser.txt +++ /dev/null @@ -1,161 +0,0 @@ -title Enable Specfied User -actor User -participant Controller.cs #90EE90 -participant RDSFactory #26abff -participant UserAccount #CBC3E3 -participant SystemAccountManager #ffffe0 -participant AccountService #ff8b3d -participant SqlDAO #D3D3D3 -//SqlDAO -database SqlServer(MariaDB) #00FFFF - -//activate User -activate Controller.cs #90EE90 -User->Controller.cs: ++Request to enable user\n by a different user++ - -//RelatDSFactory -Controller.cs->RDSFactory:++factory = new RDSFactory()++ -activate RDSFactory #26abff -RDSFactory->RDSFactory:++Constructor()++ -Controller.cs<--RDSFactory:++return RDSFactory++ -deactivate RDSFactory -Controller.cs->SqlDAO:++IDataSource factory.GetDataSource(string DbName, string connInfo)++ -activate SqlDAO #D3D3D3 -SqlDAO->SqlDAO:++Constructor(string connInfo)++ -group #red Data Store Timed Out #white -SqlDAO->SqlDAO: ++Catch SqlException++ -Controller.cs<--SqlDAO:++return "Data Source Timed Out"++ -end -group #blue Data Store Online #white -Controller.cs<--SqlDAO: ++return SqlDAO++ -deactivate SqlDAO - -// Create new Admin -Controller.cs->SystemAccountManager:++ manager = new SystemAccountManager(IDataSource conn)++ -activate SystemAccountManager #ffffe0 -SystemAccountManager->SystemAccountManager:++Constructor(IDataSource conn)++ -Controller.cs<--SystemAccountManager:++ New SystemAccountManager++ -deactivate SystemAccountManager - -// GetUserName -Controller.cs->Controller.cs:++string GetUserName()++ - -// GetPassword -Controller.cs->Controller.cs:++string GetPassword()++ - -// Pass object -Controller.cs->UserAccount:++ new UserAccount(string username,\n string password\n DateTime RegistrationTimeStamp)++ -activate UserAccount #CBC3E3 -UserAccount->UserAccount: ++Constructor(string username,\n string password,\n DateTime RegistrationTimeStamp)++ -Controller.cs<--UserAccount:++New UserAccount++ -deactivate UserAccount - -activate SystemAccountManager #ffffe0 -SystemAccountManager->SystemAccountManager:++isInputValid(user: UserAccount)++ -group #red Invalid Information #white -Controller.cs<--SystemAccountManager:++return "Invalid input"++ -User<--Controller.cs:++ return "Invalid input"++ -end -Controller.cs<--SystemAccountManager:++return true++ -deactivate SystemAccountManager - -// -Controller.cs->SystemAccountManager:++manager.EnableUserRecord(user:UserAccount)++ - -//check if there is an admin user -activate SystemAccountManager #ffffe0 -SystemAccountManager->SqlDAO:++isAdmin(user:UserAccount)++ -activate SqlDAO #D3D3D3 -SqlDAO->SqlServer(MariaDB):++SqlRead confirmAdmin()++ -activate SqlServer(MariaDB)#00FFFF -SqlServer(MariaDB)->SqlServer(MariaDB):++Select * from Admins\n where Username = @UserName \nand Password = @Pwd++ -//Unauthorized role section -group #red Unauthorized User #white -SqlDAO<--SqlServer(MariaDB):++SqlException++ -SqlDAO->SqlDAO: ++Catch\nSqlException++ -SystemAccountManager<--SqlDAO:++return false++ -Controller.cs<--SystemAccountManager:++ return "Access Denied: \nUnauthorized"++ -User<--Controller.cs:++return "Access Denied: \nUnauthorized"++ -//Unauthorized role section -end -group #red Unauthorized User #white -SqlDAO<--SqlServer(MariaDB):++return false++ -SystemAccountManager<--SqlDAO:++return false++ -Controller.cs<--SystemAccountManager:++ return "Access Denied: \nUnauthorized"++ -User<--Controller.cs:++return "Access Denied: \nUnauthorized"++ -end - - -//Authorized role section -group #blue Authorized User #white -SqlDAO<--SqlServer(MariaDB):++return true++ -deactivate SqlServer(MariaDB) -SystemAccountManager<--SqlDAO:++return true++ -deactivate SqlDAO -deactivate SystemAccountManager - -group #green Valid Information #white -activate SystemAccountManager #ffffe0 -// GetUserName -SystemAccountManager->SystemAccountManager:++string NewUserName()++ -// Enter UserName -User->SystemAccountManager:++string NewUserName++ -// GetRole -SystemAccountManager->SystemAccountManager:++string NewRole()++ -// Enter Role -User->SystemAccountManager:++string NewRole++ -// Create NewUser object -UserAccount<-SystemAccountManager:++new NewUser(\nstring NewUserName,\nstring role,\nDateTime TimeStamp)++ -activate UserAccount #CBC3E3 -UserAccount->UserAccount:++Constructor(\nstring NewUserName,\nstring role,\nDateTime TimeStamp)++ -UserAccount-->SystemAccountManager:++return NewUser++ -deactivate UserAccount -SystemAccountManager->AccountService:++AccountService\n.EnableUserRecord(user:NewUser,\nUpdateType:userEnable)++ -activate AccountService #ff8b3d -AccountService->SqlDAO:++SqlDAO\n.EnableUser(user:NewUser,\nUpdateType:userEnable)++ -activate SqlDAO #D3D3D3 -SqlDAO->SqlServer(MariaDB):++isUser(user:NewUser)++ -activate SqlServer(MariaDB) #00FFFF -SqlServer(MariaDB)->SqlServer(MariaDB):++ Select *\nFrom Users\nwhere Username\n= @UserName and\nRole = @UserRole -group #red data store timed out #white -SqlDAO<--SqlServer(MariaDB):++SqlException++ -deactivate SqlServer(MariaDB) -SqlDAO->SqlDAO: ++Catch\nSqlException++ -AccountService<--SqlDAO:++return "Database timed out"++ - -SystemAccountManager<--AccountService:++ return "Database timed out"++ -Controller.cs<--SystemAccountManager:++ return "Database timed out"++ -User<--Controller.cs:++ return "Database timed out"++ -end -group #blue data store is online #white -// User exists -group #green User does exist #white -activate SqlServer(MariaDB) #00FFFF -SqlDAO<--SqlServer(MariaDB):++ return True++ -SqlDAO->SqlServer(MariaDB):++Update users Set isActive = 1\nwhere UserName = @UserName++ -SqlDAO<--SqlServer(MariaDB):++ return 1++ -deactivate SqlServer(MariaDB) -AccountService<--SqlDAO:++return "User is now enabled"++ -SystemAccountManager<--AccountService:++return "User is now enabled"++ -Controller.cs<--SystemAccountManager:++return "User is now enabled"++ -User<--Controller.cs:++ return \n"User is now enabled"++ -end -// User doesn't exist -group #red User does not exist #white -activate SqlServer(MariaDB) #00FFFF -SqlDAO<--SqlServer(MariaDB):++ return False++ -deactivate SqlServer(MariaDB) -AccountService<--SqlDAO:++return "User does not exist"++ -deactivate SqlDAO -SystemAccountManager<--AccountService:++return "User does not exist"++ -deactivate AccountService -Controller.cs<--SystemAccountManager:++return "User does not exist"++ -deactivate SystemAccountManager -User<--Controller.cs:++ return \n"User does not exist"++ -deactivate Controller.cs -end -//deactivate User -end -end -end -end \ No newline at end of file