diff --git a/doc/LowLevel/UserManagement/Edit User Records.svg b/doc/LowLevel/UserManagement/Edit User Records.svg deleted file mode 100644 index c6aa0e5..0000000 --- a/doc/LowLevel/UserManagement/Edit User Records.svg +++ /dev/null @@ -1 +0,0 @@ -title%20Edit%20User%20Record%0Aactor%20User%0Aparticipant%20Controller.cs%20%2390EE90%0Aparticipant%20UserAccount%20%23CBC3E3%0Aparticipant%20SystemAccountManager%20%23ffffe0%0Aparticipant%20AccountService%20%23ff8b3d%0Aparticipant%20SqlDAO%20%23D3D3D3%0A%2F%2FSqlDAO%0Adatabase%20SqlServer(MariaDB)%20%2300FFFF%0A%0A%2F%2Factivate%20User%20%0Aactivate%20Controller.cs%20%2390EE90%0AUser-%3EController.cs%3A%20%2B%2BRequest%20to%20edit%20user%5Cnby%20a%20different%20user%2B%2B%0A%0A%2F%2F%20Create%20new%20Admin%0AController.cs-%3ESystemAccountManager%3A%2B%2B%20manager%20%3D%20new%20SystemAccountManager()%2B%2B%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESystemAccountManager%3AConstructor()%0ASystemAccountManager-%3ESqlDAO%3A%20%2B%2Bnew%20SqlDAO()%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlDAO%3A%20%2B%2BConstructor()%2B%2B%0ASystemAccountManager%3C--SqlDAO%3A%20%2B%2Bnew%20SqlDAO%2B%2B%0Adeactivate%20SqlDAO%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20New%20SystemAccountManager%2B%2B%0Adeactivate%20SystemAccountManager%0A%0A%2F%2F%0Aactivate%20UserAccount%20%23CBC3E3%0AController.cs-%3EUserAccount%3A%2B%2B%20new%20UserAccount(string%20username%2C%5Cn%20string%20password%2C%5Cn%20string%20email%2C%5Cn%20DateTime%20RegistrationTimeStamp)%2B%2B%0AUserAccount-%3EUserAccount%3A%20%20%2B%2Bstring%20username%2C%5Cn%20string%20password%2C%5Cn%20string%20email%2C%5Cn%20DateTime%20RegistrationTimeStamp%2B%2B%0AController.cs%3C--UserAccount%3A%2B%2BNew%20UserAccount%2B%2B%0Adeactivate%20UserAccount%0A%2F%2Flook%20over%0AController.cs-%3ESystemAccountManager%3A%20%2B%2Bmanager.UpdateUserRecord(user%3AUserAccount%2C%5CnActiveUser%3Auser%2C%20UpdateObj%3A%20userUpdate)%2B%2B%0A%0A%2F%2Fcheck%20if%20there%20is%20an%20admin%20user%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESqlDAO%3A%2B%2BisAdmin(user%3AUserAccount)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2BSqlRead%20confirmAdmin()%2B%2B%0Aactivate%20SqlServer(MariaDB)%2300FFFF%0ASqlServer(MariaDB)-%3ESqlServer(MariaDB)%3A%2B%2BSelect%20*%20from%20Admins%5Cn%20where%20Username%20%3D%20%40UserName%20%5Cnand%20Password%20%3D%20%40Pwd%2B%2B%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2Breturn%20true%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20true%2B%2B%0Adeactivate%20SqlDAO%0A%0A%2F%2FUnauthorized%20role%20section%0Agroup%20%232f2e7b%20Unauthorized%20User%20%23white%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0Adeactivate%20SystemAccountManager%0AUser%3C--Controller.cs%3A%2B%2Breturn%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0Aend%0A%0A%0A%2F%2FAuthorized%20role%20section%0Agroup%20%23blue%20Authorized%20User%20%23white%0A%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESystemAccountManager%3A%2B%2BValidCredentials(user%3A%20UserAccount)%2B%2B%0Agroup%20%23red%20Invalid%20Information%20%23white%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22Invalid%20input%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22Invalid%20input%22%2B%2B%0Adeactivate%20SystemAccountManager%0Aend%0Agroup%20%23green%20Valid%20Information%20%23white%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3EAccountService%3A%20%2B%2BAccountService%5Cn.CreateUserRecord(user%3AUserAccount%5Cn%2CActiveUser%3Auser%2C%20UpdateObj%3A%20userUpdate)%2B%2B%0Aactivate%20AccountService%20%09%23ff8b3d%0AAccountService-%3ESqlDAO%3A%20%2B%2BSqlDAO%5Cn.CreateUserRecord(user%3AUserAccount%5Cn%2CActiveUser%3Auser%2C%20UpdateObj%3A%20userUpdate)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlServer(MariaDB)%3A%20%2B%2BisUser(user%3AUserAccount)%2B%2B%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlServer(MariaDB)-%3ESqlServer(MariaDB)%3A%2B%2B%20%20Select%20*%5CnFrom%20Users%5Cnwhere%20Username%5Cn%3D%20%40UserName%20OR%5Cnemail%20%3D%20%40Email%2B%2B%0Agroup%20%23red%20data%20store%20timed%20out%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2BSqlException%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0ASqlDAO-%3ESqlDAO%3A%20%20%20%20%20%20%2B%2BCatch%5CnSqlException%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22Database%20timed%20out%22%2B%2B%0A%0ASystemAccountManager%3C--AccountService%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0Aend%0Agroup%20%23blue%20data%20store%20is%20online%20%23white%0A%2F%2F%20User%20exists%0Agroup%20%23green%20User%20does%20exist%20%23white%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%20True%2B%2B%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2B%20SQL%20insert%5Cnuser%20credentials%2B%2B%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%201%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22User%20information%20updated%20successfully%22%2B%2B%0ASystemAccountManager%3C--AccountService%3A%2B%2Breturn%20%22User%20information%20updated%20successfully%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22User%20information%20updated%20successfully%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22User%20information%5Cn%20updated%20successfully%22%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0Aend%20%0A%2F%2F%20User%20doesn't%20exist%0Agroup%20%23green%20User%20does%20not%20exist%20%23white%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%20False%2B%2B%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2B%20SQL%20insert%5Cnuser%20credentials%2B%2B%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%201%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22User%20is%20now%20registered%22%2B%2B%0ASystemAccountManager%3C--AccountService%3A%2B%2Breturn%20%22User%20is%20now%20registered%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22User%20is%20now%20registered%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%5Cn%22User%20is%20now%20registered%22%2B%2B%0Adeactivate%20AccountService%0Adeactivate%20SqlDAO%0Adeactivate%20SqlServer(MariaDB)%0Adeactivate%20SystemAccountManager%0Adeactivate%20Controller.cs%0Aend%0A%2F%2Fdeactivate%20User%0Aend%0Aend%0AendEdit User RecordUserController.csUserAccountSystemAccountManagerAccountServiceSqlDAOSqlServer(MariaDB)Request to edit userby a different user manager = new SystemAccountManager()Constructor()new SqlDAO()Constructor()new SqlDAO New SystemAccountManager new UserAccount(string username, string password, string email, DateTime RegistrationTimeStamp) string username, string password, string email, DateTime RegistrationTimeStampNew UserAccountmanager.UpdateUserRecord(user:UserAccount,ActiveUser:user, UpdateObj: userUpdate)isAdmin(user:UserAccount)SqlRead confirmAdmin()Select * from Admins where Username = @UserName and Password = @Pwdreturn truereturn true return "Access Denied: Unauthorized"return "Access Denied: Unauthorized"ValidCredentials(user: UserAccount)return "Invalid input" return "Invalid input"AccountService.CreateUserRecord(user:UserAccount,ActiveUser:user, UpdateObj: userUpdate)SqlDAO.CreateUserRecord(user:UserAccount,ActiveUser:user, UpdateObj: userUpdate)isUser(user:UserAccount)  Select *From Userswhere Username= @UserName ORemail = @EmailSqlException     CatchSqlExceptionreturn "Database timed out" return "Database timed out" return "Database timed out" return "Database timed out" return True SQL insertuser credentials return 1return "User information updated successfully"return "User information updated successfully"return "User information updated successfully" return "User information updated successfully" return False SQL insertuser credentials return 1return "User is now registered"return "User is now registered"return "User is now registered"               return "User is now registered"Unauthorized UserAuthorized UserInvalid InformationValid Informationdata store timed outdata store is onlineUser does existUser does not exist \ No newline at end of file diff --git a/doc/LowLevel/UserManagement/LogToFile_Sequence.svg b/doc/LowLevel/UserManagement/LogToFile_Sequence.svg deleted file mode 100644 index 0796128..0000000 --- a/doc/LowLevel/UserManagement/LogToFile_Sequence.svg +++ /dev/null @@ -1 +0,0 @@ -title%20Log%20Event%20to%20File%20%0A%0Aparticipant%20Controller.cs%20%23lightgreen%0Aparticipant%20LoggingManager%20%23ffffe0%0Aparticipant%20LogEntry%20%23cbc3e3%0Aparticipant%20FileLoggerFactory%20%23ff8b3d%0Aparticipant%20FileLogger%20%23D3D3D3%0A%0A%0A%0A%0A%5B-%3EController.cs%3Arequest%20to%20log%20event%20to%20file%0Aactivate%20Controller.cs%20%23lightgreen%0A%0AController.cs-%3ELoggingManager%3Amanager%20%3D%20new%20LoggingManager()%0A%0Aactivate%20LoggingManager%20%23ffffe0%0A%0ALoggingManager-%3ELoggingManager%3AConstructor()%0A%0ALoggingManager-%3ELogEntry%3A_logEntry%20%3D%20new%20LogEntry(int%20userID%2C%5CnDateTime%20timestamp%2C%20string%20level%2C%20%5Cnstring%20category%2C%20string%20message)%0A%0Aactivate%20LogEntry%20%23cbc3e3%0A%0A%0ALogEntry-%3ELogEntry%3AConstuctor(int%20userID%2C%5Cnstring%20level%2C%20%5CnDateTime%20timestamp%2C%5Cnstring%20category%2C%5Cnstring%20description)%0ALoggingManager%3C--LogEntry%3Areturn%20new%20LogEntry()%0A%0Adeactivate%20LogEntry%0ALoggingManager-%3EFileLoggerFactory%3A_loggerFactory%20%3D%20new%20FileLoggerFactory()%0Aactivate%20FileLoggerFactory%20%23ff8b3d%0A%0AFileLoggerFactory-%3EFileLoggerFactory%3A%20Constructor()%0A%0ALoggingManager%3C--FileLoggerFactory%3Areturn%20new%20FileLoggerFactory%0ALoggingManager-%3EFileLoggerFactory%3A_logger%20%3D%20_loggerFactory.CreateLogger()%0AFileLoggerFactory-%3EFileLogger%3A%20new%20FileLogger()%0A%0A%0Aactivate%20FileLogger%20%23D3D3D3%0AFileLogger-%3EFileLogger%3AConstructor()%0A%0ALoggingManager%3C--FileLogger%3Areturn%20new%20FileLogger()%0Adeactivate%20FileLoggerFactory%0A%0ALoggingManager-%3EFileLogger%3A_logger.Log(_logEntry)%0A%0Adeactivate%20LoggingManager%0AFileLogger-%3EFileLogger%3AAppendFile(LogEntry)%0A%0A%0Aalt%20%23red%20file%20not%20found%20%0AFileLogger-%3EFileLogger%3ACreateFile()%0A%0Aend%0A%0Aalt%20%23red%20insufficient%20storage%20capacity%20%0AFileLogger-%3EFileLogger%3A%20new%20IOException()%0A%0AController.cs%3C--FileLogger%3Areturn%20new%20IOException()%0Aend%20%0ALog Event to File Controller.csLoggingManagerLogEntryFileLoggerFactoryFileLoggerrequest to log event to filemanager = new LoggingManager()Constructor()_logEntry = new LogEntry(int userID,DateTime timestamp, string level, string category, string message)Constuctor(int userID,string level, DateTime timestamp,string category,string description)return new LogEntry()_loggerFactory = new FileLoggerFactory()Constructor()return new FileLoggerFactory_logger = _loggerFactory.CreateLogger()new FileLogger()Constructor()return new FileLogger()_logger.Log(_logEntry)AppendFile(LogEntry)CreateFile()new IOException()return new IOException()alt[file not found ]alt[insufficient storage capacity ] \ No newline at end of file diff --git a/doc/LowLevel/UserManagement/User Management_ Create Account - SequenceDiagram.org.pdf b/doc/LowLevel/UserManagement/User Management_ Create Account - SequenceDiagram.org.pdf deleted file mode 100644 index 154cc19..0000000 Binary files a/doc/LowLevel/UserManagement/User Management_ Create Account - SequenceDiagram.org.pdf and /dev/null differ diff --git a/doc/LowLevel/UserManagement/User Management_ Create Account.png b/doc/LowLevel/UserManagement/User Management_ Create Account.png deleted file mode 100644 index 61e4c74..0000000 Binary files a/doc/LowLevel/UserManagement/User Management_ Create Account.png and /dev/null differ diff --git a/doc/LowLevel/UserManagement/User Management_ Create Account.svg b/doc/LowLevel/UserManagement/User Management_ Create Account.svg deleted file mode 100644 index de6f5da..0000000 --- a/doc/LowLevel/UserManagement/User Management_ Create Account.svg +++ /dev/null @@ -1 +0,0 @@ -title%20Create%20User%20Record%0Aactor%20User%0Aparticipant%20Controller.cs%20%2390EE90%0Aparticipant%20RDSFactory%20%2326abff%0Aparticipant%20UserAccount%20%23CBC3E3%0Aparticipant%20SystemAccountManager%20%23ffffe0%0Aparticipant%20AccountService%20%23ff8b3d%0Aparticipant%20SqlDAO%20%23D3D3D3%0A%2F%2FSqlDAO%0Adatabase%20SqlServer(MariaDB)%20%2300FFFF%0A%0A%2F%2Factivate%20User%20%0Aactivate%20Controller.cs%20%2390EE90%0AUser-%3EController.cs%3A%20%2B%2BCreate%20new%20User%2B%2B%0A%0A%2F%2FRelatDSFactory%0AController.cs-%3ERDSFactory%3A%2B%2Bfactory%20%3D%20new%20RDSFactory()%2B%2B%0Aactivate%20RDSFactory%20%2326abff%0ARDSFactory-%3ERDSFactory%3A%2B%2BConstructor()%2B%2B%0AController.cs%3C--RDSFactory%3A%2B%2Breturn%20RDSFactory%2B%2B%0Adeactivate%20RDSFactory%0AController.cs-%3ESqlDAO%3A%20%2B%2BIDataSource%20factory.GetDataSource(string%20name%2C%20string%20connInfo)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlDAO%3A%2B%2BConstructor(string%20connInfo)%2B%2B%0Agroup%20%23red%20Data%20Store%20Timed%20Out%20%23white%0ASqlDAO-%3ESqlDAO%3A%20%2B%2BCatch%20SqlException%2B%2B%0AController.cs%3C--SqlDAO%3A%2B%2Breturn%20%22Data%20Source%20Timed%20Out%22%2B%2B%0Aend%0Agroup%20%23blue%20Data%20Store%20Online%20%23white%0AController.cs%3C--SqlDAO%3A%20%2B%2Breturn%20SqlDAO%2B%2B%0Adeactivate%20SqlDAO%0A%0A%0A%2F%2F%20Create%20new%20Admin%0AController.cs-%3ESystemAccountManager%3A%2B%2B%20manager%20%3D%20new%20SystemAccountManager(IDataSource%20conn)%2B%2B%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESystemAccountManager%3A%2B%2BConstructor(IDataSource%20conn)%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20New%20SystemAccountManager%2B%2B%0Adeactivate%20SystemAccountManager%0A%0A%2F%2F%0Aactivate%20UserAccount%20%23CBC3E3%0AController.cs-%3EUserAccount%3A%2B%2B%20new%20UserAccount(string%20username%2C%5Cn%20string%20password%2C%5Cn%20string%20email%2C%5Cn%20DateTime%20RegistrationTimeStamp)%2B%2B%0AUserAccount-%3EUserAccount%3A%20%2B%2BConstructor(string%20username%2C%5Cn%20string%20password%2C%5Cn%20string%20email%2C%5Cn%20DateTime%20RegistrationTimeStamp)%2B%2B%0AController.cs%3C--UserAccount%3A%2B%2BNew%20UserAccount%2B%2B%0Adeactivate%20UserAccount%0A%2F%2F%0AController.cs-%3ESystemAccountManager%3A%2B%2Bmanager.CreateUserRecord(user%3AUserAccount)%2B%2B%0A%0A%2F%2Fcheck%20if%20there%20is%20an%20admin%20user%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESqlDAO%3A%2B%2Bbool%20isAdmin(user%3AUserAccount)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2BSqlRead%20confirmAdmin()%2B%2B%0Aactivate%20SqlServer(MariaDB)%2300FFFF%0A%2F%2Fauthorized%0ASqlServer(MariaDB)-%3ESqlServer(MariaDB)%3A%2B%2BSelect%20*%20from%20Admins%5Cn%20where%20Username%20%3D%20%40UserName%20%5Cnand%20Password%20%3D%20%40Pwd%2B%2B%0A%2F%2FUnauthorized%20role%20section%0Agroup%20%23red%20Unauthorized%20User%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2BSqlException%2B%2B%0ASqlDAO-%3ESqlDAO%3A%20%20%20%20%20%20%2B%2BCatch%5CnSqlException%2B%2B%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20false%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2Breturn%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0Aend%0A%2F%2FUnauthorized%20role%20section%0Agroup%20%23red%20Unauthorized%20User%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2Breturn%20false%2B%2B%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20false%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2Breturn%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0Aend%0A%0A%0A%2F%2FAuthorized%20role%20section%0Agroup%20%23blue%20Authorized%20User%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2Breturn%20true%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20true%2B%2B%0Adeactivate%20SqlDAO%0Adeactivate%20SystemAccountManager%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESystemAccountManager%3A%2B%2BisInputValid(user%3A%20UserAccount)%2B%2B%0Agroup%20%23red%20Invalid%20Information%20%23white%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22Invalid%20input%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22Invalid%20input%22%2B%2B%0Adeactivate%20SystemAccountManager%0Aend%0Agroup%20%23green%20Valid%20Information%20%23white%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3EAccountService%3A%2B%2BAccountService.CreateUserRecord(user%3AUserAccount)%2B%2B%0Aactivate%20AccountService%20%09%23ff8b3d%0AAccountService-%3ESqlDAO%3A%2B%2BSqlDAO%5Cn.CreateUserRecord(user%3AUserAccount)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2BSqlRead%20%5CnisUser(user%3AUserAccount)%2B%2B%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlServer(MariaDB)-%3ESqlServer(MariaDB)%3A%2B%2B%20Select%20*%5CnFrom%20Users%5Cnwhere%20Username%5Cn%3D%20%40UserName%20OR%5Cnemail%20%3D%20%40Email%2B%2B%0Agroup%20%23red%20data%20store%20timed%20out%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2BSqlException%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0ASqlDAO-%3ESqlDAO%3A%20%20%20%20%20%20%2B%2BCatch%5CnSqlException%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22Database%20timed%20out%22%2B%2B%0A%0ASystemAccountManager%3C--AccountService%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0Aend%0Agroup%20%23blue%20data%20store%20is%20online%20%23white%0A%2F%2F%20User%20exists%0Agroup%20%23green%20User%20does%20exist%20%23white%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%20True%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22User%20is%20already%20registered%22%2B%2B%0ASystemAccountManager%3C--AccountService%3A%2B%2Breturn%20%22User%20is%20already%20registered%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22User%20is%20already%20registered%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%5Cn%22User%20is%20already%20registered%22%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0Aend%20%0A%2F%2F%20User%20doesn't%20exist%0Agroup%20%23green%20User%20does%20not%20exist%20%23white%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%20False%2B%2B%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2B%20SQL%20insert%5Cnuser%20credentials%2B%2B%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%201%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22User%20is%20now%20registered%22%2B%2B%0ASystemAccountManager%3C--AccountService%3A%2B%2Breturn%20%22User%20is%20now%20registered%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22User%20is%20now%20registered%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%5Cn%22User%20is%20now%20registered%22%2B%2B%0Adeactivate%20AccountService%0Adeactivate%20SqlDAO%0Adeactivate%20SqlServer(MariaDB)%0Adeactivate%20SystemAccountManager%0Adeactivate%20Controller.cs%0Aend%0A%2F%2Fdeactivate%20User%0Aend%0Aend%0Aend%0Aend%0AendCreate User RecordUserController.csRDSFactoryUserAccountSystemAccountManagerAccountServiceSqlDAOSqlServer(MariaDB)Create new Userfactory = new RDSFactory()Constructor()return RDSFactoryIDataSource factory.GetDataSource(string name, string connInfo)Constructor(string connInfo)Catch SqlExceptionreturn "Data Source Timed Out"return SqlDAO manager = new SystemAccountManager(IDataSource conn)Constructor(IDataSource conn) New SystemAccountManager new UserAccount(string username, string password, string email, DateTime RegistrationTimeStamp)Constructor(string username, string password, string email, DateTime RegistrationTimeStamp)New UserAccountmanager.CreateUserRecord(user:UserAccount)bool isAdmin(user:UserAccount)SqlRead confirmAdmin()Select * from Admins where Username = @UserName and Password = @PwdSqlException     CatchSqlExceptionreturn false return "Access Denied: Unauthorized"return "Access Denied: Unauthorized"return falsereturn false return "Access Denied: Unauthorized"return "Access Denied: Unauthorized"return truereturn trueisInputValid(user: UserAccount)return "Invalid input" return "Invalid input"AccountService.CreateUserRecord(user:UserAccount)SqlDAO.CreateUserRecord(user:UserAccount)SqlRead isUser(user:UserAccount) Select *From Userswhere Username= @UserName ORemail = @EmailSqlException     CatchSqlExceptionreturn "Database timed out" return "Database timed out" return "Database timed out" return "Database timed out" return Truereturn "User is already registered"return "User is already registered"return "User is already registered"               return "User is already registered" return False SQL insertuser credentials return 1return "User is now registered"return "User is now registered"return "User is now registered"               return "User is now registered"Data Store Timed OutData Store OnlineUnauthorized UserUnauthorized UserAuthorized UserInvalid InformationValid Informationdata store timed outdata store is onlineUser does existUser does not exist \ No newline at end of file diff --git a/doc/LowLevel/UserManagement/UserManagementCreateAccount.pdf b/doc/LowLevel/UserManagement/UserManagementCreateAccount.pdf new file mode 100644 index 0000000..a03b9c3 Binary files /dev/null and b/doc/LowLevel/UserManagement/UserManagementCreateAccount.pdf differ diff --git a/doc/LowLevel/UserManagement/UserManagementCreateAccount.png b/doc/LowLevel/UserManagement/UserManagementCreateAccount.png new file mode 100644 index 0000000..97c8438 Binary files /dev/null and b/doc/LowLevel/UserManagement/UserManagementCreateAccount.png differ diff --git a/doc/LowLevel/UserManagement/UserManagementCreateAccount.svg b/doc/LowLevel/UserManagement/UserManagementCreateAccount.svg new file mode 100644 index 0000000..01080e8 --- /dev/null +++ b/doc/LowLevel/UserManagement/UserManagementCreateAccount.svg @@ -0,0 +1 @@ +title%20Create%20User%20Record%0Aactor%20User%0Aparticipant%20Controller.cs%20%2390EE90%0Aparticipant%20RDSFactory%20%2326abff%0Aparticipant%20UserAccount%20%23CBC3E3%0Aparticipant%20SystemAccountManager%20%23ffffe0%0Aparticipant%20AccountService%20%23ff8b3d%0Aparticipant%20SqlDAO%20%23D3D3D3%0A%2F%2FSqlDAO%0Adatabase%20SqlServer(MariaDB)%20%2300FFFF%0A%0A%2F%2Factivate%20User%20%0Aactivate%20Controller.cs%20%2390EE90%0AUser-%3EController.cs%3A%20%2B%2BCreate%20new%20User%2B%2B%0A%0A%2F%2FRelatDSFactory%0AController.cs-%3ERDSFactory%3A%2B%2Bfactory%20%3D%20new%20RDSFactory()%2B%2B%0Aactivate%20RDSFactory%20%2326abff%0ARDSFactory-%3ERDSFactory%3A%2B%2BConstructor()%2B%2B%0AController.cs%3C--RDSFactory%3A%2B%2Breturn%20RDSFactory%2B%2B%0Adeactivate%20RDSFactory%0AController.cs-%3ESqlDAO%3A%2B%2BIDataSource%20factory.GetDataSource(string%20DbName%2C%20string%20connInfo)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlDAO%3A%2B%2BConstructor(string%20connInfo)%2B%2B%0Agroup%20%23red%20Data%20Store%20Timed%20Out%20%23white%0ASqlDAO-%3ESqlDAO%3A%20%2B%2BCatch%20SqlException%2B%2B%0AController.cs%3C--SqlDAO%3A%2B%2Breturn%20%22Data%20Source%20Timed%20Out%22%2B%2B%0Aend%0Agroup%20%23blue%20Data%20Store%20Online%20%23white%0AController.cs%3C--SqlDAO%3A%20%2B%2Breturn%20SqlDAO%2B%2B%0Adeactivate%20SqlDAO%0A%0A%0A%2F%2F%20Create%20new%20Admin%0AController.cs-%3ESystemAccountManager%3A%2B%2B%20manager%20%3D%20new%20SystemAccountManager(IDataSource%20conn)%2B%2B%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESystemAccountManager%3A%2B%2BConstructor(IDataSource%20conn)%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20New%20SystemAccountManager%2B%2B%0Adeactivate%20SystemAccountManager%0A%0A%2F%2F%0Aactivate%20UserAccount%20%23CBC3E3%0AController.cs-%3EUserAccount%3A%2B%2B%20new%20UserAccount(string%20username%2C%5Cn%20string%20password%2C%5Cn%20string%20email%2C%5Cn%20DateTime%20RegistrationTimeStamp)%2B%2B%0AUserAccount-%3EUserAccount%3A%20%2B%2BConstructor(string%20username%2C%5Cn%20string%20password%2C%5Cn%20string%20email%2C%5Cn%20DateTime%20RegistrationTimeStamp)%2B%2B%0AController.cs%3C--UserAccount%3A%2B%2BNew%20UserAccount%2B%2B%0Adeactivate%20UserAccount%0A%2F%2F%0AController.cs-%3ESystemAccountManager%3A%2B%2Bmanager.CreateUserRecord(user%3AUserAccount)%2B%2B%0A%0A%2F%2Fcheck%20if%20there%20is%20an%20admin%20user%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESqlDAO%3A%2B%2Bbool%20isAdmin(user%3AUserAccount)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2BSqlRead%20confirmAdmin()%2B%2B%0Aactivate%20SqlServer(MariaDB)%2300FFFF%0A%2F%2Fauthorized%0ASqlServer(MariaDB)-%3ESqlServer(MariaDB)%3A%2B%2BSelect%20*%20from%20Admins%5Cn%20where%20Username%20%3D%20%40UserName%20%5Cnand%20Password%20%3D%20%40Pwd%2B%2B%0A%2F%2FUnauthorized%20role%20section%0Agroup%20%23red%20Unauthorized%20User%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2BSqlException%2B%2B%0ASqlDAO-%3ESqlDAO%3A%20%20%20%20%20%20%2B%2BCatch%5CnSqlException%2B%2B%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20false%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2Breturn%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0Aend%0A%2F%2FUnauthorized%20role%20section%0Agroup%20%23red%20Unauthorized%20User%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2Breturn%20false%2B%2B%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20false%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2Breturn%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0Aend%0A%0A%0A%2F%2FAuthorized%20role%20section%0Agroup%20%23blue%20Authorized%20User%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2Breturn%20true%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20true%2B%2B%0Adeactivate%20SqlDAO%0Adeactivate%20SystemAccountManager%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESystemAccountManager%3A%2B%2BisInputValid(user%3A%20UserAccount)%2B%2B%0A%0Agroup%20%23red%20Invalid%20Information%20%23white%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22Invalid%20input%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22Invalid%20input%22%2B%2B%0Adeactivate%20SystemAccountManager%0Aend%0Agroup%20%23green%20Valid%20Information%20%23white%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3EAccountService%3A%2B%2BAccountService%5Cn.CreateUserRecord(user%3AUserAccount)%2B%2B%0Aactivate%20AccountService%20%09%23ff8b3d%0AAccountService-%3ESqlDAO%3A%2B%2BSqlDAO%5Cn.CreateUserRecord(user%3AUserAccount)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2BSqlRead%20%5CnisUser(user%3AUserAccount)%2B%2B%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlServer(MariaDB)-%3ESqlServer(MariaDB)%3A%2B%2B%20Select%20*%5CnFrom%20Users%5Cnwhere%20Username%5Cn%3D%20%40UserName%20OR%5Cnemail%20%3D%20%40Email%2B%2B%0Agroup%20%23red%20data%20store%20timed%20out%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2BSqlException%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0ASqlDAO-%3ESqlDAO%3A%20%20%20%20%20%20%2B%2BCatch%5CnSqlException%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22Database%20timed%20out%22%2B%2B%0A%0ASystemAccountManager%3C--AccountService%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0Aend%0Agroup%20%23blue%20data%20store%20is%20online%20%23white%0A%2F%2F%20User%20exists%0Agroup%20%23green%20User%20does%20exist%20%23white%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%20True%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22User%20is%20already%20registered%22%2B%2B%0ASystemAccountManager%3C--AccountService%3A%2B%2Breturn%20%22User%20is%20already%20registered%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22User%20is%20already%20registered%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%5Cn%22User%20is%20already%20registered%22%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0Aend%20%0A%2F%2F%20User%20doesn't%20exist%0Agroup%20%23green%20User%20does%20not%20exist%20%23white%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%20False%2B%2B%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2B%20SQL%20insert%5Cnuser%20credentials%2B%2B%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%201%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22User%20is%20now%20registered%22%2B%2B%0ASystemAccountManager%3C--AccountService%3A%2B%2Breturn%20%22User%20is%20now%20registered%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22User%20is%20now%20registered%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%5Cn%22User%20is%20now%20registered%22%2B%2B%0Adeactivate%20AccountService%0Adeactivate%20SqlDAO%0Adeactivate%20SqlServer(MariaDB)%0Adeactivate%20SystemAccountManager%0Adeactivate%20Controller.cs%0Aend%0A%2F%2Fdeactivate%20User%0Aend%0Aend%0Aend%0Aend%0AendCreate User RecordUserController.csRDSFactoryUserAccountSystemAccountManagerAccountServiceSqlDAOSqlServer(MariaDB)Create new Userfactory = new RDSFactory()Constructor()return RDSFactoryIDataSource factory.GetDataSource(string DbName, string connInfo)Constructor(string connInfo)Catch SqlExceptionreturn "Data Source Timed Out"return SqlDAO manager = new SystemAccountManager(IDataSource conn)Constructor(IDataSource conn) New SystemAccountManager new UserAccount(string username, string password, string email, DateTime RegistrationTimeStamp)Constructor(string username, string password, string email, DateTime RegistrationTimeStamp)New UserAccountmanager.CreateUserRecord(user:UserAccount)bool isAdmin(user:UserAccount)SqlRead confirmAdmin()Select * from Admins where Username = @UserName and Password = @PwdSqlException     CatchSqlExceptionreturn false return "Access Denied: Unauthorized"return "Access Denied: Unauthorized"return falsereturn false return "Access Denied: Unauthorized"return "Access Denied: Unauthorized"return truereturn trueisInputValid(user: UserAccount)return "Invalid input" return "Invalid input"AccountService.CreateUserRecord(user:UserAccount)SqlDAO.CreateUserRecord(user:UserAccount)SqlRead isUser(user:UserAccount) Select *From Userswhere Username= @UserName ORemail = @EmailSqlException     CatchSqlExceptionreturn "Database timed out" return "Database timed out" return "Database timed out" return "Database timed out" return Truereturn "User is already registered"return "User is already registered"return "User is already registered"               return "User is already registered" return False SQL insertuser credentials return 1return "User is now registered"return "User is now registered"return "User is now registered"               return "User is now registered"Data Store Timed OutData Store OnlineUnauthorized UserUnauthorized UserAuthorized UserInvalid InformationValid Informationdata store timed outdata store is onlineUser does existUser does not exist \ No newline at end of file diff --git a/doc/LowLevel/UserManagement/User Management_ Create Account.txt b/doc/LowLevel/UserManagement/UserManagementCreateAccount.txt similarity index 96% rename from doc/LowLevel/UserManagement/User Management_ Create Account.txt rename to doc/LowLevel/UserManagement/UserManagementCreateAccount.txt index ba4e2df..e43ef61 100644 --- a/doc/LowLevel/UserManagement/User Management_ Create Account.txt +++ b/doc/LowLevel/UserManagement/UserManagementCreateAccount.txt @@ -19,7 +19,7 @@ activate RDSFactory #26abff RDSFactory->RDSFactory:++Constructor()++ Controller.cs<--RDSFactory:++return RDSFactory++ deactivate RDSFactory -Controller.cs->SqlDAO: ++IDataSource factory.GetDataSource(string name, string connInfo)++ +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 @@ -81,6 +81,7 @@ deactivate SqlDAO deactivate SystemAccountManager 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"++ @@ -88,7 +89,7 @@ deactivate SystemAccountManager end group #green Valid Information #white activate SystemAccountManager #ffffe0 -SystemAccountManager->AccountService:++AccountService.CreateUserRecord(user:UserAccount)++ +SystemAccountManager->AccountService:++AccountService\n.CreateUserRecord(user:UserAccount)++ activate AccountService #ff8b3d AccountService->SqlDAO:++SqlDAO\n.CreateUserRecord(user:UserAccount)++ activate SqlDAO #D3D3D3 diff --git a/doc/LowLevel/UserManagement/UserManagementDeleteUser.pdf b/doc/LowLevel/UserManagement/UserManagementDeleteUser.pdf new file mode 100644 index 0000000..fe134a2 Binary files /dev/null and b/doc/LowLevel/UserManagement/UserManagementDeleteUser.pdf differ diff --git a/doc/LowLevel/UserManagement/UserManagementDeleteUser.png b/doc/LowLevel/UserManagement/UserManagementDeleteUser.png new file mode 100644 index 0000000..2dd92f6 Binary files /dev/null and b/doc/LowLevel/UserManagement/UserManagementDeleteUser.png differ diff --git a/doc/LowLevel/UserManagement/UserManagementDeleteUser.svg b/doc/LowLevel/UserManagement/UserManagementDeleteUser.svg new file mode 100644 index 0000000..a8ba692 --- /dev/null +++ b/doc/LowLevel/UserManagement/UserManagementDeleteUser.svg @@ -0,0 +1 @@ +title%20Delete%20User%20Record%0Aactor%20User%0Aparticipant%20Controller.cs%20%2390EE90%0Aparticipant%20RDSFactory%20%2326abff%0Aparticipant%20UserAccount%20%23CBC3E3%0Aparticipant%20SystemAccountManager%20%23ffffe0%0Aparticipant%20AccountService%20%23ff8b3d%0Aparticipant%20SqlDAO%20%23D3D3D3%0A%2F%2FSqlDAO%0Adatabase%20SqlServer(MariaDB)%20%2300FFFF%0A%0A%2F%2Factivate%20User%20%0Aactivate%20Controller.cs%20%2390EE90%0AUser-%3EController.cs%3A%20%2B%2BRequest%20to%20delete%20user%2B%2B%0A%0A%2F%2FRelatDSFactory%0AController.cs-%3ERDSFactory%3A%2B%2Bfactory%20%3D%20new%20RDSFactory()%2B%2B%0Aactivate%20RDSFactory%20%2326abff%0ARDSFactory-%3ERDSFactory%3A%2B%2BConstructor()%2B%2B%0AController.cs%3C--RDSFactory%3A%2B%2Breturn%20RDSFactory%2B%2B%0Adeactivate%20RDSFactory%0AController.cs-%3ESqlDAO%3A%2B%2BIDataSource%20factory.GetDataSource(string%20DbName%2C%20string%20connInfo)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlDAO%3A%2B%2BConstructor(string%20connInfo)%2B%2B%0Agroup%20%23red%20Data%20Store%20Timed%20Out%20%23white%0ASqlDAO-%3ESqlDAO%3A%20%2B%2BCatch%20SqlException%2B%2B%0AController.cs%3C--SqlDAO%3A%2B%2Breturn%20%22Data%20Source%20Timed%20Out%22%2B%2B%0Aend%0Agroup%20%23blue%20Data%20Store%20Online%20%23white%0AController.cs%3C--SqlDAO%3A%20%2B%2Breturn%20SqlDAO%2B%2B%0Adeactivate%20SqlDAO%0A%0A%2F%2F%20Create%20new%20Admin%0AController.cs-%3ESystemAccountManager%3A%2B%2B%20manager%20%3D%20new%20SystemAccountManager(IDataSource%20conn)%2B%2B%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESystemAccountManager%3A%2B%2BConstructor(IDataSource%20conn)%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20New%20SystemAccountManager%2B%2B%0Adeactivate%20SystemAccountManager%0A%0A%2F%2F%0Aactivate%20UserAccount%20%23CBC3E3%0AController.cs-%3EUserAccount%3A%2B%2B%20new%20UserAccount(string%20username%2C%5Cn%20string%20password%5Cn%20DateTime%20RegistrationTimeStamp)%2B%2B%0AUserAccount-%3EUserAccount%3A%20%20%2B%2BConstructor(string%20username%2C%5Cn%20string%20password%2C%5Cn%20DateTime%20RegistrationTimeStamp)%2B%2B%0AController.cs%3C--UserAccount%3A%2B%2BNew%20UserAccount%2B%2B%0Adeactivate%20UserAccount%0A%2F%2F%0AController.cs-%3ESystemAccountManager%3A%20%2B%2Bmanager.DeleteUserRecord(user%3AUserAccount)%2B%2B%0A%0A%2F%2Fcheck%20if%20there%20is%20an%20admin%20user%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESqlDAO%3A%2B%2BisAdmin(user%3AUserAccount)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2BSqlRead%20confirmAdmin()%2B%2B%0Aactivate%20SqlServer(MariaDB)%2300FFFF%0ASqlServer(MariaDB)-%3ESqlServer(MariaDB)%3A%2B%2BSelect%20*%20from%20Admins%5Cn%20where%20Username%20%3D%20%40UserName%20%5Cnand%20Password%20%3D%20%40Pwd%2B%2B%0A%2F%2FUnauthorized%20role%20section%0Agroup%20%23red%20Unauthorized%20User%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2BSqlException%2B%2B%0ASqlDAO-%3ESqlDAO%3A%20%20%20%20%20%20%2B%2BCatch%5CnSqlException%2B%2B%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20false%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2Breturn%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0Aend%0A%2F%2FUnauthorized%20role%20section%0Agroup%20%23red%20Unauthorized%20User%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2Breturn%20false%2B%2B%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20false%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2Breturn%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0Aend%0A%0A%0A%2F%2FAuthorized%20role%20section%0Agroup%20%23blue%20Authorized%20User%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2Breturn%20true%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20true%2B%2B%0Adeactivate%20SqlDAO%0Adeactivate%20SystemAccountManager%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESystemAccountManager%3A%2B%2BisInputValid(user%3A%20UserAccount)%2B%2B%0Agroup%20%23red%20Invalid%20Information%20%23white%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22Invalid%20input%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22Invalid%20input%22%2B%2B%0Adeactivate%20SystemAccountManager%0Aend%0Agroup%20%23green%20Valid%20Information%20%23white%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3EAccountService%3A%2B%2BAccountService%5Cn.DeleteUserRecord(user%3AUserAccount)%2B%2B%0Aactivate%20AccountService%20%09%23ff8b3d%0AAccountService-%3ESqlDAO%3A%2B%2BSqlDAO%5Cn.DeleteUserRecord(user%3AUserAccount)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlServer(MariaDB)%3A%20%2B%2BisUser(user%3AUserAccount)%2B%2B%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlServer(MariaDB)-%3ESqlServer(MariaDB)%3A%2B%2B%20Select%20*%5CnFrom%20Users%5Cnwhere%20Username%5Cn%3D%20%40UserName%20OR%5Cnemail%20%3D%20%40Email%2B%2B%0Agroup%20%23red%20data%20store%20timed%20out%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2BSqlException%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0ASqlDAO-%3ESqlDAO%3A%20%20%20%20%20%20%2B%2BCatch%5CnSqlException%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22Database%20timed%20out%22%2B%2B%0A%0ASystemAccountManager%3C--AccountService%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0Aend%0Agroup%20%23blue%20data%20store%20is%20online%20%23white%0A%2F%2F%20User%20exists%0Agroup%20%23green%20User%20does%20exist%20%23white%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%20True%2B%2B%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2BDelete%20from%20users%5Cnwhere%20Username%20%3D%20%40UserName%20%5Cnand%20Password%20%3D%20%40PWD%2B%2B%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%201%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22User%20deleted%20successfully%22%2B%2B%0ASystemAccountManager%3C--AccountService%3A%2B%2Breturn%20%22User%20deleted%20successfully%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22User%20deleted%20successfully%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%5Cn%22User%20deleted%20successfully%22%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0Aend%20%0A%2F%2F%20User%20doesn't%20exist%0Agroup%20%23red%20User%20does%20not%20exist%20%23white%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%20False%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22User%20does%20not%20exist%22%2B%2B%0ASystemAccountManager%3C--AccountService%3A%2B%2Breturn%20%22User%20does%20not%20exist%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22User%20does%20not%20exist%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%5Cn%22User%20does%20not%20exist%22%2B%2B%0Adeactivate%20AccountService%0Adeactivate%20SqlDAO%0Adeactivate%20SqlServer(MariaDB)%0Adeactivate%20SystemAccountManager%0Adeactivate%20Controller.cs%0Aend%0A%2F%2Fdeactivate%20User%0Aend%0Aend%0Aend%0AendDelete User RecordUserController.csRDSFactoryUserAccountSystemAccountManagerAccountServiceSqlDAOSqlServer(MariaDB)Request to delete userfactory = new RDSFactory()Constructor()return RDSFactoryIDataSource factory.GetDataSource(string DbName, string connInfo)Constructor(string connInfo)Catch SqlExceptionreturn "Data Source Timed Out"return SqlDAO manager = new SystemAccountManager(IDataSource conn)Constructor(IDataSource conn) New SystemAccountManager new UserAccount(string username, string password DateTime RegistrationTimeStamp) Constructor(string username, string password, DateTime RegistrationTimeStamp)New UserAccountmanager.DeleteUserRecord(user:UserAccount)isAdmin(user:UserAccount)SqlRead confirmAdmin()Select * from Admins where Username = @UserName and Password = @PwdSqlException     CatchSqlExceptionreturn false return "Access Denied: Unauthorized"return "Access Denied: Unauthorized"return falsereturn false return "Access Denied: Unauthorized"return "Access Denied: Unauthorized"return truereturn trueisInputValid(user: UserAccount)return "Invalid input" return "Invalid input"AccountService.DeleteUserRecord(user:UserAccount)SqlDAO.DeleteUserRecord(user:UserAccount)isUser(user:UserAccount) Select *From Userswhere Username= @UserName ORemail = @EmailSqlException     CatchSqlExceptionreturn "Database timed out" return "Database timed out" return "Database timed out" return "Database timed out" return TrueDelete from userswhere Username = @UserName and Password = @PWD return 1return "User deleted successfully"return "User deleted successfully"return "User deleted successfully"               return "User deleted successfully" return Falsereturn "User does not exist"return "User does not exist"return "User does not exist"               return "User does not exist"Data Store Timed OutData Store OnlineUnauthorized UserUnauthorized UserAuthorized UserInvalid InformationValid Informationdata store timed outdata store is onlineUser does existUser does not exist \ No newline at end of file diff --git a/doc/LowLevel/UserManagement/UserManagementDeleteUser.txt b/doc/LowLevel/UserManagement/UserManagementDeleteUser.txt new file mode 100644 index 0000000..cac7cf6 --- /dev/null +++ b/doc/LowLevel/UserManagement/UserManagementDeleteUser.txt @@ -0,0 +1,137 @@ +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 + +// +activate UserAccount #CBC3E3 +Controller.cs->UserAccount:++ new UserAccount(string username,\n string password\n DateTime RegistrationTimeStamp)++ +UserAccount->UserAccount: ++Constructor(string username,\n string password,\n DateTime RegistrationTimeStamp)++ +Controller.cs<--UserAccount:++New UserAccount++ +deactivate UserAccount +// +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 +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"++ +deactivate SystemAccountManager +end +group #green Valid Information #white +activate SystemAccountManager #ffffe0 +SystemAccountManager->AccountService:++AccountService\n.DeleteUserRecord(user:UserAccount)++ +activate AccountService #ff8b3d +AccountService->SqlDAO:++SqlDAO\n.DeleteUserRecord(user:UserAccount)++ +activate SqlDAO #D3D3D3 +SqlDAO->SqlServer(MariaDB): ++isUser(user:UserAccount)++ +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++ +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.pdf b/doc/LowLevel/UserManagement/UserManagementDisableUser.pdf new file mode 100644 index 0000000..b86b934 Binary files /dev/null and b/doc/LowLevel/UserManagement/UserManagementDisableUser.pdf differ diff --git a/doc/LowLevel/UserManagement/UserManagementDisableUser.png b/doc/LowLevel/UserManagement/UserManagementDisableUser.png new file mode 100644 index 0000000..c1580f8 Binary files /dev/null and b/doc/LowLevel/UserManagement/UserManagementDisableUser.png differ diff --git a/doc/LowLevel/UserManagement/UserManagementDisableUser.svg b/doc/LowLevel/UserManagement/UserManagementDisableUser.svg new file mode 100644 index 0000000..40ff29a --- /dev/null +++ b/doc/LowLevel/UserManagement/UserManagementDisableUser.svg @@ -0,0 +1 @@ +title%20Disable%20Specfied%20User%0Aactor%20User%0Aparticipant%20Controller.cs%20%2390EE90%0Aparticipant%20RDSFactory%20%2326abff%0Aparticipant%20UserAccount%20%23CBC3E3%0Aparticipant%20SystemAccountManager%20%23ffffe0%0Aparticipant%20AccountService%20%23ff8b3d%0Aparticipant%20SqlDAO%20%23D3D3D3%0A%2F%2FSqlDAO%0Adatabase%20SqlServer(MariaDB)%20%2300FFFF%0A%0A%2F%2Factivate%20User%20%0Aactivate%20Controller.cs%20%2390EE90%0AUser-%3EController.cs%3A%20%2B%2BRequest%20to%20disable%20user%5Cn%20by%20a%20different%20user%2B%2B%0A%0A%2F%2FRelatDSFactory%0AController.cs-%3ERDSFactory%3A%2B%2Bfactory%20%3D%20new%20RDSFactory()%2B%2B%0Aactivate%20RDSFactory%20%2326abff%0ARDSFactory-%3ERDSFactory%3A%2B%2BConstructor()%2B%2B%0AController.cs%3C--RDSFactory%3A%2B%2Breturn%20RDSFactory%2B%2B%0Adeactivate%20RDSFactory%0AController.cs-%3ESqlDAO%3A%2B%2BIDataSource%20factory.GetDataSource(string%20DbName%2C%20string%20connInfo)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlDAO%3A%2B%2BConstructor(string%20connInfo)%2B%2B%0Agroup%20%23red%20Data%20Store%20Timed%20Out%20%23white%0ASqlDAO-%3ESqlDAO%3A%20%2B%2BCatch%20SqlException%2B%2B%0AController.cs%3C--SqlDAO%3A%2B%2Breturn%20%22Data%20Source%20Timed%20Out%22%2B%2B%0Aend%0Agroup%20%23blue%20Data%20Store%20Online%20%23white%0AController.cs%3C--SqlDAO%3A%20%2B%2Breturn%20SqlDAO%2B%2B%0Adeactivate%20SqlDAO%0A%0A%2F%2F%20Create%20new%20Admin%0AController.cs-%3ESystemAccountManager%3A%2B%2B%20manager%20%3D%20new%20SystemAccountManager(IDataSource%20conn)%2B%2B%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESystemAccountManager%3A%2B%2BConstructor(IDataSource%20conn)%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20New%20SystemAccountManager%2B%2B%0Adeactivate%20SystemAccountManager%0A%0A%2F%2F%20Pass%20object%0Aactivate%20UserAccount%20%23CBC3E3%0AController.cs-%3EUserAccount%3A%2B%2B%20new%20UserAccount(string%20username%2C%5Cn%20string%20password%5Cn%20DateTime%20RegistrationTimeStamp)%2B%2B%0AUserAccount-%3EUserAccount%3A%20%20%2B%2BConstructor(string%20username%2C%5Cn%20string%20password%2C%5Cn%20DateTime%20RegistrationTimeStamp)%2B%2B%0AController.cs%3C--UserAccount%3A%2B%2BNew%20UserAccount%2B%2B%0Adeactivate%20UserAccount%0A%2F%2F%0AController.cs-%3ESystemAccountManager%3A%20%2B%2Bmanager.DisableUserRecord(user%3AUserAccount)%2B%2B%0A%0A%2F%2Fcheck%20if%20there%20is%20an%20admin%20user%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESqlDAO%3A%2B%2BisAdmin(user%3AUserAccount)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2BSqlRead%20confirmAdmin()%2B%2B%0Aactivate%20SqlServer(MariaDB)%2300FFFF%0ASqlServer(MariaDB)-%3ESqlServer(MariaDB)%3A%2B%2BSelect%20*%20from%20Admins%5Cn%20where%20Username%20%3D%20%40UserName%20%5Cnand%20Password%20%3D%20%40Pwd%2B%2B%0A%2F%2FUnauthorized%20role%20section%0Agroup%20%23red%20Unauthorized%20User%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2BSqlException%2B%2B%0ASqlDAO-%3ESqlDAO%3A%20%20%20%20%20%20%2B%2BCatch%5CnSqlException%2B%2B%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20false%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2Breturn%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0A%2F%2FUnauthorized%20role%20section%0Aend%0Agroup%20%23red%20Unauthorized%20User%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2Breturn%20false%2B%2B%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20false%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2Breturn%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0Aend%0A%0A%0A%2F%2FAuthorized%20role%20section%0Agroup%20%23blue%20Authorized%20User%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2Breturn%20true%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20true%2B%2B%0Adeactivate%20SqlDAO%0Adeactivate%20SystemAccountManager%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESystemAccountManager%3A%2B%2BisInputValid(user%3A%20UserAccount)%2B%2B%0A%0Agroup%20%23red%20Invalid%20Information%20%23white%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22Invalid%20input%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22Invalid%20input%22%2B%2B%0Adeactivate%20SystemAccountManager%0Aend%0Agroup%20%23green%20Valid%20Information%20%23white%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3EAccountService%3A%2B%2BAccountService%5Cn.DisableUserRecord(user%3AUserAccount)%2B%2B%0Aactivate%20AccountService%20%09%23ff8b3d%0AAccountService-%3ESqlDAO%3A%2B%2BSqlDAO%5Cn.DisableUser(user%3AUserAccount)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlServer(MariaDB)%3A%20%2B%2BisUser(user%3AUserAccount)%2B%2B%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlServer(MariaDB)-%3ESqlServer(MariaDB)%3A%2B%2B%20Select%20*%5CnFrom%20Users%5Cnwhere%20Username%5Cn%3D%20%40UserName%20OR%5Cnemail%20%3D%20%40Email%2B%2B%0Agroup%20%23red%20data%20store%20timed%20out%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2BSqlException%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0ASqlDAO-%3ESqlDAO%3A%20%20%20%20%20%20%2B%2BCatch%5CnSqlException%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22Database%20timed%20out%22%2B%2B%0A%0ASystemAccountManager%3C--AccountService%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0Aend%0Agroup%20%23blue%20data%20store%20is%20online%20%23white%0A%2F%2F%20User%20exists%0Agroup%20%23green%20User%20does%20exist%20%23white%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%20True%2B%2B%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2BUpdate%20users%20Set%20isActive%20%3D%200%5Cnwhere%20UserName%20%3D%20%40UserName%2B%2B%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%201%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22User%20is%20now%20disabled%22%2B%2B%0ASystemAccountManager%3C--AccountService%3A%2B%2Breturn%20%22User%20is%20now%20disabled%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22User%20is%20now%20disabled%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%5Cn%22User%20is%20now%20disabled%22%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0Aend%20%0A%2F%2F%20User%20doesn't%20exist%0Agroup%20%23red%20User%20does%20not%20exist%20%23white%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%20False%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22User%20does%20not%20exist%22%2B%2B%0ASystemAccountManager%3C--AccountService%3A%2B%2Breturn%20%22User%20does%20not%20exist%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22User%20does%20not%20exist%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%5Cn%22User%20does%20not%20exist%22%2B%2B%0Adeactivate%20AccountService%0Adeactivate%20SqlDAO%0Adeactivate%20SqlServer(MariaDB)%0Adeactivate%20SystemAccountManager%0Adeactivate%20Controller.cs%0Aend%0A%2F%2Fdeactivate%20User%0Aend%0Aend%0Aend%0AendDisable Specfied UserUserController.csRDSFactoryUserAccountSystemAccountManagerAccountServiceSqlDAOSqlServer(MariaDB)Request to disable user by a different userfactory = new RDSFactory()Constructor()return RDSFactoryIDataSource factory.GetDataSource(string DbName, string connInfo)Constructor(string connInfo)Catch SqlExceptionreturn "Data Source Timed Out"return SqlDAO manager = new SystemAccountManager(IDataSource conn)Constructor(IDataSource conn) New SystemAccountManager new UserAccount(string username, string password DateTime RegistrationTimeStamp) Constructor(string username, string password, DateTime RegistrationTimeStamp)New UserAccountmanager.DisableUserRecord(user:UserAccount)isAdmin(user:UserAccount)SqlRead confirmAdmin()Select * from Admins where Username = @UserName and Password = @PwdSqlException     CatchSqlExceptionreturn false return "Access Denied: Unauthorized"return "Access Denied: Unauthorized"return falsereturn false return "Access Denied: Unauthorized"return "Access Denied: Unauthorized"return truereturn trueisInputValid(user: UserAccount)return "Invalid input" return "Invalid input"AccountService.DisableUserRecord(user:UserAccount)SqlDAO.DisableUser(user:UserAccount)isUser(user:UserAccount) Select *From Userswhere Username= @UserName ORemail = @EmailSqlException     CatchSqlExceptionreturn "Database timed out" return "Database timed out" return "Database timed out" return "Database timed out" return TrueUpdate users Set isActive = 0where UserName = @UserName return 1return "User is now disabled"return "User is now disabled"return "User is now disabled"               return "User is now disabled" return Falsereturn "User does not exist"return "User does not exist"return "User does not exist"               return "User does not exist"Data Store Timed OutData Store OnlineUnauthorized UserUnauthorized UserAuthorized UserInvalid InformationValid Informationdata store timed outdata store is onlineUser does existUser does not exist \ No newline at end of file diff --git a/doc/LowLevel/UserManagement/UserManagementDisableUser.txt b/doc/LowLevel/UserManagement/UserManagementDisableUser.txt new file mode 100644 index 0000000..0cad143 --- /dev/null +++ b/doc/LowLevel/UserManagement/UserManagementDisableUser.txt @@ -0,0 +1,138 @@ +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 + +// Pass object +activate UserAccount #CBC3E3 +Controller.cs->UserAccount:++ new UserAccount(string username,\n string password\n DateTime RegistrationTimeStamp)++ +UserAccount->UserAccount: ++Constructor(string username,\n string password,\n DateTime RegistrationTimeStamp)++ +Controller.cs<--UserAccount:++New UserAccount++ +deactivate UserAccount +// +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 +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"++ +deactivate SystemAccountManager +end +group #green Valid Information #white +activate SystemAccountManager #ffffe0 +SystemAccountManager->AccountService:++AccountService\n.DisableUserRecord(user:UserAccount)++ +activate AccountService #ff8b3d +AccountService->SqlDAO:++SqlDAO\n.DisableUser(user:UserAccount)++ +activate SqlDAO #D3D3D3 +SqlDAO->SqlServer(MariaDB): ++isUser(user:UserAccount)++ +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++ +SqlDAO->SqlServer(MariaDB):++Update users Set isActive = 0\nwhere UserName = @UserName++ +SqlDAO<--SqlServer(MariaDB):++ return 1++ +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"++ +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/UserManagementEditUserRecords.pdf b/doc/LowLevel/UserManagement/UserManagementEditUserRecords.pdf new file mode 100644 index 0000000..7886dc1 Binary files /dev/null and b/doc/LowLevel/UserManagement/UserManagementEditUserRecords.pdf differ diff --git a/doc/LowLevel/UserManagement/UserManagementEditUserRecords.png b/doc/LowLevel/UserManagement/UserManagementEditUserRecords.png new file mode 100644 index 0000000..07c3ea7 Binary files /dev/null and b/doc/LowLevel/UserManagement/UserManagementEditUserRecords.png differ diff --git a/doc/LowLevel/UserManagement/UserManagementEditUserRecords.svg b/doc/LowLevel/UserManagement/UserManagementEditUserRecords.svg new file mode 100644 index 0000000..a2a1fac --- /dev/null +++ b/doc/LowLevel/UserManagement/UserManagementEditUserRecords.svg @@ -0,0 +1 @@ +title%20Edit%20User%20Record%0Aactor%20User%0Aparticipant%20Controller.cs%20%2390EE90%0Aparticipant%20RDSFactory%20%2326abff%0Aparticipant%20UserAccount%20%23CBC3E3%0Aparticipant%20SystemAccountManager%20%23ffffe0%0Aparticipant%20AccountService%20%23ff8b3d%0Aparticipant%20SqlDAO%20%23D3D3D3%0A%2F%2FSqlDAO%0Adatabase%20SqlServer(MariaDB)%20%2300FFFF%0A%0A%2F%2Factivate%20User%20%0Aactivate%20Controller.cs%20%2390EE90%0AUser-%3EController.cs%3A%20%2B%2BRequest%20to%20edit%20user%5Cnby%20a%20different%20user%2B%2B%0A%0A%2F%2FRelatDSFactory%0AController.cs-%3ERDSFactory%3A%2B%2Bfactory%20%3D%20new%20RDSFactory()%2B%2B%0Aactivate%20RDSFactory%20%2326abff%0ARDSFactory-%3ERDSFactory%3A%2B%2BConstructor()%2B%2B%0AController.cs%3C--RDSFactory%3A%2B%2Breturn%20RDSFactory%2B%2B%0Adeactivate%20RDSFactory%0AController.cs-%3ESqlDAO%3A%2B%2BIDataSource%20factory.GetDataSource(string%20DbName%2C%20string%20connInfo)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlDAO%3A%2B%2BConstructor(string%20connInfo)%2B%2B%0Agroup%20%23red%20Data%20Store%20Timed%20Out%20%23white%0ASqlDAO-%3ESqlDAO%3A%20%2B%2BCatch%20SqlException%2B%2B%0AController.cs%3C--SqlDAO%3A%2B%2Breturn%20%22Data%20Source%20Timed%20Out%22%2B%2B%0Aend%0Agroup%20%23blue%20Data%20Store%20Online%20%23white%0AController.cs%3C--SqlDAO%3A%20%2B%2Breturn%20SqlDAO%2B%2B%0Adeactivate%20SqlDAO%0A%0A%2F%2F%20Create%20new%20Admin%0AController.cs-%3ESystemAccountManager%3A%2B%2B%20manager%20%3D%20new%20SystemAccountManager(IDataSource%20conn)%2B%2B%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESystemAccountManager%3A%2B%2BConstructor(IDataSource%20conn)%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20New%20SystemAccountManager%2B%2B%0Adeactivate%20SystemAccountManager%0A%0A%2F%2F%0Aactivate%20UserAccount%20%23CBC3E3%0AController.cs-%3EUserAccount%3A%2B%2B%20new%20UserAccount(string%20username%2C%5Cn%20string%20password%2C%5Cn%20string%20email%2C%5Cn%20DateTime%20RegistrationTimeStamp)%2B%2B%0AUserAccount-%3EUserAccount%3A%20%20%2B%2Bstring%20username%2C%5Cn%20string%20password%2C%5Cn%20string%20email%2C%5Cn%20DateTime%20RegistrationTimeStamp%2B%2B%0AController.cs%3C--UserAccount%3A%2B%2BNew%20UserAccount%2B%2B%0Adeactivate%20UserAccount%0A%2F%2Flook%20over%0AController.cs-%3ESystemAccountManager%3A%20%2B%2Bmanager.UpdateUserRecord(user%3AUserAccount%2C%5CnActiveUser%3Auser%2C%20UpdateObj%3A%20userUpdate)%2B%2B%0A%0A%2F%2Fcheck%20if%20there%20is%20an%20admin%20user%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESqlDAO%3A%2B%2Bbool%20isAdmin(user%3AUserAccount)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2BSqlRead%20confirmAdmin()%2B%2B%0Aactivate%20SqlServer(MariaDB)%2300FFFF%0A%2F%2Fauthorized%0ASqlServer(MariaDB)-%3ESqlServer(MariaDB)%3A%2B%2BSelect%20*%20from%20Admins%5Cn%20where%20Username%20%3D%20%40UserName%20%5Cnand%20Password%20%3D%20%40Pwd%2B%2B%0A%2F%2FUnauthorized%20role%20section%0Agroup%20%23red%20Unauthorized%20User%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2BSqlException%2B%2B%0ASqlDAO-%3ESqlDAO%3A%20%20%20%20%20%20%2B%2BCatch%5CnSqlException%2B%2B%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20false%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2Breturn%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0Aend%0A%2F%2FUnauthorized%20role%20section%0Agroup%20%23red%20Unauthorized%20User%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2Breturn%20false%2B%2B%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20false%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2Breturn%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0Aend%0A%0A%0A%2F%2FAuthorized%20role%20section%0Agroup%20%23blue%20Authorized%20User%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2Breturn%20true%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20true%2B%2B%0Adeactivate%20SqlDAO%0Adeactivate%20SystemAccountManager%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESystemAccountManager%3A%2B%2BisInputValid(user%3A%20UserAccount)%2B%2B%0Agroup%20%23red%20Invalid%20Information%20%23white%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22Invalid%20input%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22Invalid%20input%22%2B%2B%0Adeactivate%20SystemAccountManager%0Aend%0Agroup%20%23green%20Valid%20Information%20%23white%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3EAccountService%3A%20%2B%2BAccountService%5Cn.CreateUserRecord(user%3AUserAccount%5Cn%2CActiveUser%3Auser%2C%20UpdateObj%3A%20userUpdate)%2B%2B%0Aactivate%20AccountService%20%09%23ff8b3d%0AAccountService-%3ESqlDAO%3A%20%2B%2BSqlDAO%5Cn.CreateUserRecord(user%3AUserAccount%5Cn%2CActiveUser%3Auser%2C%20UpdateObj%3A%20userUpdate)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlServer(MariaDB)%3A%20%2B%2BisUser(user%3AUserAccount)%2B%2B%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlServer(MariaDB)-%3ESqlServer(MariaDB)%3A%2B%2B%20%20Select%20*%5CnFrom%20Users%5Cnwhere%20Username%5Cn%3D%20%40UserName%20OR%5Cnemail%20%3D%20%40Email%2B%2B%0Agroup%20%23red%20data%20store%20timed%20out%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2BSqlException%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0ASqlDAO-%3ESqlDAO%3A%20%20%20%20%20%20%2B%2BCatch%5CnSqlException%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22Database%20timed%20out%22%2B%2B%0A%0ASystemAccountManager%3C--AccountService%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0Aend%0Agroup%20%23blue%20data%20store%20is%20online%20%23white%0A%2F%2F%20User%20exists%0Agroup%20%23green%20User%20does%20exist%20%23white%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%20True%2B%2B%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2B%20SQL%20insert%5Cnuser%20credentials%2B%2B%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%201%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22User%20information%20updated%20successfully%22%2B%2B%0ASystemAccountManager%3C--AccountService%3A%2B%2Breturn%20%22User%20information%20updated%20successfully%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22User%20information%20updated%20successfully%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22User%20information%5Cn%20updated%20successfully%22%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0Aend%20%0A%2F%2F%20User%20doesn't%20exist%0Agroup%20%23green%20User%20does%20not%20exist%20%23white%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%20False%2B%2B%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2B%20SQL%20insert%5Cnuser%20credentials%2B%2B%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%201%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22User%20is%20now%20registered%22%2B%2B%0ASystemAccountManager%3C--AccountService%3A%2B%2Breturn%20%22User%20is%20now%20registered%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22User%20is%20now%20registered%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%5Cn%22User%20is%20now%20registered%22%2B%2B%0Adeactivate%20AccountService%0Adeactivate%20SqlDAO%0Adeactivate%20SqlServer(MariaDB)%0Adeactivate%20SystemAccountManager%0Adeactivate%20Controller.cs%0Aend%0A%2F%2Fdeactivate%20User%0Aend%0Aend%0Aend%0AendEdit User RecordUserController.csRDSFactoryUserAccountSystemAccountManagerAccountServiceSqlDAOSqlServer(MariaDB)Request to edit userby a different userfactory = new RDSFactory()Constructor()return RDSFactoryIDataSource factory.GetDataSource(string DbName, string connInfo)Constructor(string connInfo)Catch SqlExceptionreturn "Data Source Timed Out"return SqlDAO manager = new SystemAccountManager(IDataSource conn)Constructor(IDataSource conn) New SystemAccountManager new UserAccount(string username, string password, string email, DateTime RegistrationTimeStamp) string username, string password, string email, DateTime RegistrationTimeStampNew UserAccountmanager.UpdateUserRecord(user:UserAccount,ActiveUser:user, UpdateObj: userUpdate)bool isAdmin(user:UserAccount)SqlRead confirmAdmin()Select * from Admins where Username = @UserName and Password = @PwdSqlException     CatchSqlExceptionreturn false return "Access Denied: Unauthorized"return "Access Denied: Unauthorized"return falsereturn false return "Access Denied: Unauthorized"return "Access Denied: Unauthorized"return truereturn trueisInputValid(user: UserAccount)return "Invalid input" return "Invalid input"AccountService.CreateUserRecord(user:UserAccount,ActiveUser:user, UpdateObj: userUpdate)SqlDAO.CreateUserRecord(user:UserAccount,ActiveUser:user, UpdateObj: userUpdate)isUser(user:UserAccount)  Select *From Userswhere Username= @UserName ORemail = @EmailSqlException     CatchSqlExceptionreturn "Database timed out" return "Database timed out" return "Database timed out" return "Database timed out" return True SQL insertuser credentials return 1return "User information updated successfully"return "User information updated successfully"return "User information updated successfully" return "User information updated successfully" return False SQL insertuser credentials return 1return "User is now registered"return "User is now registered"return "User is now registered"               return "User is now registered"Data Store Timed OutData Store OnlineUnauthorized UserUnauthorized UserAuthorized UserInvalid InformationValid Informationdata store timed outdata store is onlineUser does existUser does not exist \ No newline at end of file diff --git a/doc/LowLevel/UserManagement/UserManagementEditUserRecords.txt b/doc/LowLevel/UserManagement/UserManagementEditUserRecords.txt new file mode 100644 index 0000000..68e50a3 --- /dev/null +++ b/doc/LowLevel/UserManagement/UserManagementEditUserRecords.txt @@ -0,0 +1,140 @@ +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 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 + +// +activate UserAccount #CBC3E3 +Controller.cs->UserAccount:++ new UserAccount(string username,\n string password,\n string email,\n DateTime RegistrationTimeStamp)++ +UserAccount->UserAccount: ++string username,\n string password,\n string email,\n DateTime RegistrationTimeStamp++ +Controller.cs<--UserAccount:++New UserAccount++ +deactivate UserAccount +//look over +Controller.cs->SystemAccountManager: ++manager.UpdateUserRecord(user:UserAccount,\nActiveUser:user, UpdateObj: userUpdate)++ + +//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 +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"++ +deactivate SystemAccountManager +end +group #green Valid Information #white +activate SystemAccountManager #ffffe0 +SystemAccountManager->AccountService: ++AccountService\n.CreateUserRecord(user:UserAccount\n,ActiveUser:user, UpdateObj: userUpdate)++ +activate AccountService #ff8b3d +AccountService->SqlDAO: ++SqlDAO\n.CreateUserRecord(user:UserAccount\n,ActiveUser:user, UpdateObj: userUpdate)++ +activate SqlDAO #D3D3D3 +SqlDAO->SqlServer(MariaDB): ++isUser(user:UserAccount)++ +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++ +SqlDAO->SqlServer(MariaDB):++ SQL insert\nuser credentials++ +SqlDAO<--SqlServer(MariaDB):++ return 1++ +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"++ +deactivate SqlServer(MariaDB) +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++ +AccountService<--SqlDAO:++return "User is now registered"++ +SystemAccountManager<--AccountService:++return "User is now registered"++ +Controller.cs<--SystemAccountManager:++return "User is now registered"++ +User<--Controller.cs:++ return \n"User is now registered"++ +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/User_Management_ Disable User.svg b/doc/LowLevel/UserManagement/User_Management_ Disable User.svg deleted file mode 100644 index 241c171..0000000 --- a/doc/LowLevel/UserManagement/User_Management_ Disable User.svg +++ /dev/null @@ -1 +0,0 @@ -title%20Disable%20Specfied%20User%0Aactor%20User%0Aparticipant%20Controller.cs%20%2390EE90%0Aparticipant%20UserAccount%20%23CBC3E3%0Aparticipant%20SystemAccountManager%20%23ffffe0%0Aparticipant%20AccountService%20%23ff8b3d%0Aparticipant%20SqlDAO%20%23D3D3D3%0A%2F%2FSqlDAO%0Adatabase%20SqlServer(MariaDB)%20%2300FFFF%0A%0A%2F%2Factivate%20User%20%0Aactivate%20Controller.cs%20%2390EE90%0AUser-%3EController.cs%3A%20%2B%2BRequest%20to%20disable%20user%5Cn%20by%20a%20different%20user%2B%2B%0A%0A%2F%2F%20Create%20new%20Admin%0AController.cs-%3ESystemAccountManager%3A%2B%2B%20manager%20%3D%20new%20SystemAccountManager()%2B%2B%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESystemAccountManager%3AConstructor()%0ASystemAccountManager-%3ESqlDAO%3A%20%2B%2Bnew%20SqlDAO()%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlDAO%3A%20%2B%2BConstructor()%2B%2B%0ASystemAccountManager%3C--SqlDAO%3A%20%2B%2Bnew%20SqlDAO%2B%2B%0Adeactivate%20SqlDAO%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20New%20SystemAccountManager%2B%2B%0Adeactivate%20SystemAccountManager%0A%0A%2F%2F%0Aactivate%20UserAccount%20%23CBC3E3%0AController.cs-%3EUserAccount%3A%2B%2B%20new%20UserAccount(string%20username%2C%5Cn%20string%20password%5Cn%20DateTime%20RegistrationTimeStamp)%2B%2B%0AUserAccount-%3EUserAccount%3A%20%20%2B%2BConstructor(string%20username%2C%5Cn%20string%20password%2C%5Cn%20DateTime%20RegistrationTimeStamp)%2B%2B%0AController.cs%3C--UserAccount%3A%2B%2BNew%20UserAccount%2B%2B%0Adeactivate%20UserAccount%0A%2F%2F%0AController.cs-%3ESystemAccountManager%3A%20%2B%2Bmanager.DisableUserRecord(user%3AUserAccount)%2B%2B%0A%0A%2F%2Fcheck%20if%20there%20is%20an%20admin%20user%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESqlDAO%3A%2B%2BisAdmin(user%3AUserAccount)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2BSqlRead%20confirmAdmin()%2B%2B%0Aactivate%20SqlServer(MariaDB)%2300FFFF%0ASqlServer(MariaDB)-%3ESqlServer(MariaDB)%3A%2B%2BSelect%20*%20from%20Admins%5Cn%20where%20Username%20%3D%20%40UserName%20%5Cnand%20Password%20%3D%20%40Pwd%2B%2B%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2Breturn%20true%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20true%2B%2B%0Adeactivate%20SqlDAO%0A%0A%2F%2FUnauthorized%20role%20section%0Agroup%20%232f2e7b%20Unauthorized%20User%20%23white%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0Adeactivate%20SystemAccountManager%0AUser%3C--Controller.cs%3A%2B%2Breturn%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0Aend%0A%0A%0A%2F%2FAuthorized%20role%20section%0Agroup%20%23blue%20Authorized%20User%20%23white%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESystemAccountManager%3A%2B%2BValidCredentials(user%3A%20UserAccount)%2B%2B%0Agroup%20%23red%20Invalid%20Information%20%23white%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22Invalid%20input%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22Invalid%20input%22%2B%2B%0Adeactivate%20SystemAccountManager%0Aend%0Agroup%20%23green%20Valid%20Information%20%23white%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3EAccountService%3A%20%2B%2BAccountService.DisableUserRecord(user%3AUserAccount)%2B%2B%0Aactivate%20AccountService%20%09%23ff8b3d%0AAccountService-%3ESqlDAO%3A%20%2B%2BSqlDAO%5Cn.DisableUserRecord(user%3AUserAccount)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlServer(MariaDB)%3A%20%2B%2BisUser(user%3AUserAccount)%2B%2B%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlServer(MariaDB)-%3ESqlServer(MariaDB)%3A%2B%2B%20Select%20*%5CnFrom%20Users%5Cnwhere%20Username%5Cn%3D%20%40UserName%20OR%5Cnemail%20%3D%20%40Email%2B%2B%0Agroup%20%23red%20data%20store%20timed%20out%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2BSqlException%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0ASqlDAO-%3ESqlDAO%3A%20%20%20%20%20%20%2B%2BCatch%5CnSqlException%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22Database%20timed%20out%22%2B%2B%0A%0ASystemAccountManager%3C--AccountService%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0Aend%0Agroup%20%23blue%20data%20store%20is%20online%20%23white%0A%2F%2F%20User%20exists%0Agroup%20%23green%20User%20does%20exist%20%23white%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%20True%2B%2B%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2B%20SQL%20insert%5Cndisable%20command%2B%2B%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%201%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22User%20is%20now%20disabled%22%2B%2B%0ASystemAccountManager%3C--AccountService%3A%2B%2Breturn%20%22User%20is%20now%20disabled%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22User%20is%20now%20disabled%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%5Cn%22User%20is%20now%20disabled%22%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0Aend%20%0A%2F%2F%20User%20doesn't%20exist%0Agroup%20%23red%20User%20does%20not%20exist%20%23white%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%20False%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22User%20does%20not%20exist%22%2B%2B%0ASystemAccountManager%3C--AccountService%3A%2B%2Breturn%20%22User%20does%20not%20exist%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22User%20does%20not%20exist%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%5Cn%22User%20does%20not%20exist%22%2B%2B%0Adeactivate%20AccountService%0Adeactivate%20SqlDAO%0Adeactivate%20SqlServer(MariaDB)%0Adeactivate%20SystemAccountManager%0Adeactivate%20Controller.cs%0Aend%0A%2F%2Fdeactivate%20User%0Aend%0Aend%0AendDisable Specfied UserUserController.csUserAccountSystemAccountManagerAccountServiceSqlDAOSqlServer(MariaDB)Request to disable user by a different user manager = new SystemAccountManager()Constructor()new SqlDAO()Constructor()new SqlDAO New SystemAccountManager new UserAccount(string username, string password DateTime RegistrationTimeStamp) Constructor(string username, string password, DateTime RegistrationTimeStamp)New UserAccountmanager.DisableUserRecord(user:UserAccount)isAdmin(user:UserAccount)SqlRead confirmAdmin()Select * from Admins where Username = @UserName and Password = @Pwdreturn truereturn true return "Access Denied: Unauthorized"return "Access Denied: Unauthorized"ValidCredentials(user: UserAccount)return "Invalid input" return "Invalid input"AccountService.DisableUserRecord(user:UserAccount)SqlDAO.DisableUserRecord(user:UserAccount)isUser(user:UserAccount) Select *From Userswhere Username= @UserName ORemail = @EmailSqlException     CatchSqlExceptionreturn "Database timed out" return "Database timed out" return "Database timed out" return "Database timed out" return True SQL insertdisable command return 1return "User is now disabled"return "User is now disabled"return "User is now disabled"               return "User is now disabled" return Falsereturn "User does not exist"return "User does not exist"return "User does not exist"               return "User does not exist"Unauthorized UserAuthorized UserInvalid InformationValid Informationdata store timed outdata store is onlineUser does existUser does not exist \ No newline at end of file diff --git a/doc/LowLevel/UserManagement/User_Management_DeleteUser.svg b/doc/LowLevel/UserManagement/User_Management_DeleteUser.svg deleted file mode 100644 index def39fb..0000000 --- a/doc/LowLevel/UserManagement/User_Management_DeleteUser.svg +++ /dev/null @@ -1 +0,0 @@ -title%20Delete%20User%20Record%0Aactor%20User%0Aparticipant%20Controller.cs%20%2390EE90%0Aparticipant%20UserAccount%20%23CBC3E3%0Aparticipant%20SystemAccountManager%20%23ffffe0%0Aparticipant%20AccountService%20%23ff8b3d%0Aparticipant%20SqlDAO%20%23D3D3D3%0A%2F%2FSqlDAO%0Adatabase%20SqlServer(MariaDB)%20%2300FFFF%0A%0A%2F%2Factivate%20User%20%0Aactivate%20Controller.cs%20%2390EE90%0AUser-%3EController.cs%3A%20%2B%2BRequest%20to%20delete%20user%2B%2B%0A%0A%2F%2F%20Create%20new%20Admin%0AController.cs-%3ESystemAccountManager%3A%2B%2B%20manager%20%3D%20new%20SystemAccountManager()%2B%2B%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESystemAccountManager%3AConstructor()%0ASystemAccountManager-%3ESqlDAO%3A%20%2B%2Bnew%20SqlDAO()%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlDAO%3A%20%2B%2BConstructor()%2B%2B%0ASystemAccountManager%3C--SqlDAO%3A%20%2B%2Bnew%20SqlDAO%2B%2B%0Adeactivate%20SqlDAO%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20New%20SystemAccountManager%2B%2B%0Adeactivate%20SystemAccountManager%0A%0A%2F%2F%0Aactivate%20UserAccount%20%23CBC3E3%0AController.cs-%3EUserAccount%3A%2B%2B%20new%20UserAccount(string%20username%2C%5Cn%20string%20password%5Cn%20DateTime%20RegistrationTimeStamp)%2B%2B%0AUserAccount-%3EUserAccount%3A%20%20%2B%2BConstructor(string%20username%2C%5Cn%20string%20password%2C%5Cn%20DateTime%20RegistrationTimeStamp)%2B%2B%0AController.cs%3C--UserAccount%3A%2B%2BNew%20UserAccount%2B%2B%0Adeactivate%20UserAccount%0A%2F%2F%0AController.cs-%3ESystemAccountManager%3A%20%2B%2Bmanager.DeleteUserRecord(user%3AUserAccount)%2B%2B%0A%0A%2F%2Fcheck%20if%20there%20is%20an%20admin%20user%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESqlDAO%3A%2B%2BisAdmin(user%3AUserAccount)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2BSqlRead%20confirmAdmin()%2B%2B%0Aactivate%20SqlServer(MariaDB)%2300FFFF%0ASqlServer(MariaDB)-%3ESqlServer(MariaDB)%3A%2B%2BSelect%20*%20from%20Admins%5Cn%20where%20Username%20%3D%20%40UserName%20%5Cnand%20Password%20%3D%20%40Pwd%2B%2B%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2Breturn%20true%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0ASystemAccountManager%3C--SqlDAO%3A%2B%2Breturn%20true%2B%2B%0Adeactivate%20SqlDAO%0A%0A%2F%2FUnauthorized%20role%20section%0Agroup%20%232f2e7b%20Unauthorized%20User%20%23white%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0Adeactivate%20SystemAccountManager%0AUser%3C--Controller.cs%3A%2B%2Breturn%20%22Access%20Denied%3A%20%5CnUnauthorized%22%2B%2B%0Aend%0A%0A%0A%2F%2FAuthorized%20role%20section%0Agroup%20%23blue%20Authorized%20User%20%23white%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3ESystemAccountManager%3A%2B%2BValidCredentials(user%3A%20UserAccount)%2B%2B%0Agroup%20%23red%20Invalid%20Information%20%23white%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22Invalid%20input%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22Invalid%20input%22%2B%2B%0Adeactivate%20SystemAccountManager%0Aend%0Agroup%20%23green%20Valid%20Information%20%23white%0Aactivate%20SystemAccountManager%20%23ffffe0%0ASystemAccountManager-%3EAccountService%3A%20%2B%2BAccountService.DeleteUserRecord(user%3AUserAccount)%2B%2B%0Aactivate%20AccountService%20%09%23ff8b3d%0AAccountService-%3ESqlDAO%3A%20%2B%2BSqlDAO%5Cn.DeleteUserRecord(user%3AUserAccount)%2B%2B%0Aactivate%20SqlDAO%20%23D3D3D3%0ASqlDAO-%3ESqlServer(MariaDB)%3A%20%2B%2BisUser(user%3AUserAccount)%2B%2B%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlServer(MariaDB)-%3ESqlServer(MariaDB)%3A%2B%2B%20Select%20*%5CnFrom%20Users%5Cnwhere%20Username%5Cn%3D%20%40UserName%20OR%5Cnemail%20%3D%20%40Email%2B%2B%0Agroup%20%23red%20data%20store%20timed%20out%20%23white%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2BSqlException%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0ASqlDAO-%3ESqlDAO%3A%20%20%20%20%20%20%2B%2BCatch%5CnSqlException%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22Database%20timed%20out%22%2B%2B%0A%0ASystemAccountManager%3C--AccountService%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20return%20%22Database%20timed%20out%22%2B%2B%0Aend%0Agroup%20%23blue%20data%20store%20is%20online%20%23white%0A%2F%2F%20User%20exists%0Agroup%20%23green%20User%20does%20exist%20%23white%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%20True%2B%2B%0ASqlDAO-%3ESqlServer(MariaDB)%3A%2B%2BDelete%20from%20users%5Cnwhere%20Username%20%3D%20%40UserName%20and%20Password%20%3D%20%40PWD%2B%2B%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%201%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22User%20deleted%20successfully%22%2B%2B%0ASystemAccountManager%3C--AccountService%3A%2B%2Breturn%20%22User%20deleted%20successfully%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22User%20deleted%20successfully%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%5Cn%22User%20deleted%20successfully%22%2B%2B%0Adeactivate%20SqlServer(MariaDB)%0Aend%20%0A%2F%2F%20User%20doesn't%20exist%0Agroup%20%23red%20User%20does%20not%20exist%20%23white%0Aactivate%20SqlServer(MariaDB)%20%2300FFFF%0ASqlDAO%3C--SqlServer(MariaDB)%3A%2B%2B%20return%20False%2B%2B%0AAccountService%3C--SqlDAO%3A%2B%2Breturn%20%22User%20does%20not%20exist%22%2B%2B%0ASystemAccountManager%3C--AccountService%3A%2B%2Breturn%20%22User%20does%20not%20exist%22%2B%2B%0AController.cs%3C--SystemAccountManager%3A%2B%2Breturn%20%22User%20does%20not%20exist%22%2B%2B%0AUser%3C--Controller.cs%3A%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%5Cn%22User%20does%20not%20exist%22%2B%2B%0Adeactivate%20AccountService%0Adeactivate%20SqlDAO%0Adeactivate%20SqlServer(MariaDB)%0Adeactivate%20SystemAccountManager%0Adeactivate%20Controller.cs%0Aend%0A%2F%2Fdeactivate%20User%0Aend%0Aend%0AendDelete User RecordUserController.csUserAccountSystemAccountManagerAccountServiceSqlDAOSqlServer(MariaDB)Request to delete user manager = new SystemAccountManager()Constructor()new SqlDAO()Constructor()new SqlDAO New SystemAccountManager new UserAccount(string username, string password DateTime RegistrationTimeStamp) Constructor(string username, string password, DateTime RegistrationTimeStamp)New UserAccountmanager.DeleteUserRecord(user:UserAccount)isAdmin(user:UserAccount)SqlRead confirmAdmin()Select * from Admins where Username = @UserName and Password = @Pwdreturn truereturn true return "Access Denied: Unauthorized"return "Access Denied: Unauthorized"ValidCredentials(user: UserAccount)return "Invalid input" return "Invalid input"AccountService.DeleteUserRecord(user:UserAccount)SqlDAO.DeleteUserRecord(user:UserAccount)isUser(user:UserAccount) Select *From Userswhere Username= @UserName ORemail = @EmailSqlException     CatchSqlExceptionreturn "Database timed out" return "Database timed out" return "Database timed out" return "Database timed out" return TrueDelete from userswhere Username = @UserName and Password = @PWD return 1return "User deleted successfully"return "User deleted successfully"return "User deleted successfully"               return "User deleted successfully" return Falsereturn "User does not exist"return "User does not exist"return "User does not exist"               return "User does not exist"Unauthorized UserAuthorized UserInvalid InformationValid Informationdata store timed outdata store is onlineUser does existUser does not exist \ No newline at end of file