diff --git a/doc/LowLevel/UserManagement/UserManagementCreateAccount.pdf b/doc/LowLevel/UserManagement/UserManagementCreateAccount.pdf deleted file mode 100644 index a03b9c3..0000000 Binary files a/doc/LowLevel/UserManagement/UserManagementCreateAccount.pdf and /dev/null differ diff --git a/doc/LowLevel/UserManagement/UserManagementCreateAccount.png b/doc/LowLevel/UserManagement/UserManagementCreateAccount.png index 97c8438..59f6ae3 100644 Binary files a/doc/LowLevel/UserManagement/UserManagementCreateAccount.png and b/doc/LowLevel/UserManagement/UserManagementCreateAccount.png differ diff --git a/doc/LowLevel/UserManagement/UserManagementCreateAccount.svg b/doc/LowLevel/UserManagement/UserManagementCreateAccount.svg deleted file mode 100644 index 01080e8..0000000 --- a/doc/LowLevel/UserManagement/UserManagementCreateAccount.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%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/UserManagementCreateAccount.txt b/doc/LowLevel/UserManagement/UserManagementCreateAccount.txt index e43ef61..be31f4c 100644 --- a/doc/LowLevel/UserManagement/UserManagementCreateAccount.txt +++ b/doc/LowLevel/UserManagement/UserManagementCreateAccount.txt @@ -23,7 +23,7 @@ Controller.cs->SqlDAO:++IDataSource factory.GetDataSource(string DbName, string activate SqlDAO #D3D3D3 SqlDAO->SqlDAO:++Constructor(string connInfo)++ group #red Data Store Timed Out #white -SqlDAO->SqlDAO: ++Catch SqlException++ +SqlDAO->SqlDAO:++Catch Exception++ Controller.cs<--SqlDAO:++return "Data Source Timed Out"++ end group #blue Data Store Online #white @@ -38,12 +38,27 @@ SystemAccountManager->SystemAccountManager:++Constructor(IDataSource conn)++ Controller.cs<--SystemAccountManager:++ New SystemAccountManager++ deactivate SystemAccountManager +// GetUserName +Controller.cs->Controller.cs:++string GetUserName()++ + +// GetPassword +Controller.cs->Controller.cs:++string GetPassword()++ // +Controller.cs->UserAccount:++ new UserAccount(string username,\n string password,\n DateTime TimeStamp)++ activate UserAccount #CBC3E3 -Controller.cs->UserAccount:++ new UserAccount(string username,\n string password,\n string email,\n DateTime RegistrationTimeStamp)++ -UserAccount->UserAccount: ++Constructor(string username,\n string password,\n string email,\n DateTime RegistrationTimeStamp)++ +UserAccount->UserAccount:++Constructor(string username,\n string password,\n DateTime TimeStamp)++ Controller.cs<--UserAccount:++New UserAccount++ deactivate UserAccount + +activate SystemAccountManager #ffffe0 +SystemAccountManager->SystemAccountManager:++isInputValid(user: UserAccount)++ + +group #red Invalid Information #white +Controller.cs<--SystemAccountManager:++return "Invalid input"++ +User<--Controller.cs:++ return "Invalid input"++ +end +Controller.cs<--SystemAccountManager:++return true++ +deactivate SystemAccountManager // Controller.cs->SystemAccountManager:++manager.CreateUserRecord(user:UserAccount)++ @@ -79,21 +94,37 @@ 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)++ +// GetUserName +SystemAccountManager->SystemAccountManager:++string NewUserName()++ +// Enter UserName +User->SystemAccountManager:++string NewUserName++ +// GetPassword +SystemAccountManager->SystemAccountManager:++string NewPassword()++ +// Enter Password +User->SystemAccountManager:++string NewPassword++ +// GetEmail +SystemAccountManager->SystemAccountManager:++string NewEmail()++ +// Enter Email +User->SystemAccountManager:++string NewEmail++ +// GetRole +SystemAccountManager->SystemAccountManager:++string NewRole()++ +// Enter Role +User->SystemAccountManager:++string NewRole++ +// Create NewUser object +UserAccount<-SystemAccountManager:++new NewUser(\nstring NewUserName,\nstring NewPassword,\nstring New Email,\nstring NewRole,\nDateTime TimeStamp)++ +activate UserAccount #CBC3E3 +UserAccount->UserAccount:++Constructor(\nstring NewUserName,\nstring NewPassword,\nstring New Email,\nstring NewRole,\nDateTime TimeStamp)++ +UserAccount-->SystemAccountManager:++return NewUser++ +deactivate UserAccount +//Create User Record +SystemAccountManager->AccountService:++AccountService\n.CreateUserRecord(user:NewUser)++ activate AccountService #ff8b3d -AccountService->SqlDAO:++SqlDAO\n.CreateUserRecord(user:UserAccount)++ +AccountService->SqlDAO:++SqlDAO\n.CreateUserRecord(user:NewUser)++ activate SqlDAO #D3D3D3 -SqlDAO->SqlServer(MariaDB):++SqlRead \nisUser(user:UserAccount)++ +SqlDAO->SqlServer(MariaDB):++SqlRead \nisUser(user:NewUser)++ activate SqlServer(MariaDB) #00FFFF SqlServer(MariaDB)->SqlServer(MariaDB):++ Select *\nFrom Users\nwhere Username\n= @UserName OR\nemail = @Email++ group #red data store timed out #white @@ -111,11 +142,12 @@ group #blue data store is online #white group #green User does exist #white activate SqlServer(MariaDB) #00FFFF SqlDAO<--SqlServer(MariaDB):++ return True++ +deactivate SqlServer(MariaDB) AccountService<--SqlDAO:++return "User is already registered"++ SystemAccountManager<--AccountService:++return "User is already registered"++ Controller.cs<--SystemAccountManager:++return "User is already registered"++ User<--Controller.cs:++ return \n"User is already registered"++ -deactivate SqlServer(MariaDB) + end // User doesn't exist group #green User does not exist #white @@ -123,14 +155,15 @@ 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) +AccountService<--SqlDAO:++return "User is now registered"++ +deactivate SqlDAO +SystemAccountManager<--AccountService:++return "User is now registered"++ +deactivate AccountService +Controller.cs<--SystemAccountManager:++return "User is now registered"++ deactivate SystemAccountManager +User<--Controller.cs:++ return \n"User is now registered"++ + deactivate Controller.cs end //deactivate User @@ -138,4 +171,3 @@ end end end end -end \ No newline at end of file diff --git a/doc/LowLevel/UserManagement/UserManagementDeleteUser.pdf b/doc/LowLevel/UserManagement/UserManagementDeleteUser.pdf deleted file mode 100644 index fe134a2..0000000 Binary files a/doc/LowLevel/UserManagement/UserManagementDeleteUser.pdf and /dev/null differ diff --git a/doc/LowLevel/UserManagement/UserManagementDeleteUser.png b/doc/LowLevel/UserManagement/UserManagementDeleteUser.png index 2dd92f6..65a0ff1 100644 Binary files a/doc/LowLevel/UserManagement/UserManagementDeleteUser.png and b/doc/LowLevel/UserManagement/UserManagementDeleteUser.png differ diff --git a/doc/LowLevel/UserManagement/UserManagementDeleteUser.svg b/doc/LowLevel/UserManagement/UserManagementDeleteUser.svg deleted file mode 100644 index a8ba692..0000000 --- a/doc/LowLevel/UserManagement/UserManagementDeleteUser.svg +++ /dev/null @@ -1 +0,0 @@ -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 index cac7cf6..4d57538 100644 --- a/doc/LowLevel/UserManagement/UserManagementDeleteUser.txt +++ b/doc/LowLevel/UserManagement/UserManagementDeleteUser.txt @@ -37,12 +37,28 @@ SystemAccountManager->SystemAccountManager:++Constructor(IDataSource conn)++ Controller.cs<--SystemAccountManager:++ New SystemAccountManager++ deactivate SystemAccountManager +// GetUserName +Controller.cs->Controller.cs:++string GetUserName()++ + +// GetPassword +Controller.cs->Controller.cs:++string GetPassword()++ + // -activate UserAccount #CBC3E3 Controller.cs->UserAccount:++ new UserAccount(string username,\n string password\n DateTime RegistrationTimeStamp)++ +activate UserAccount #CBC3E3 UserAccount->UserAccount: ++Constructor(string username,\n string password,\n DateTime RegistrationTimeStamp)++ Controller.cs<--UserAccount:++New UserAccount++ deactivate UserAccount + +activate SystemAccountManager #ffffe0 +SystemAccountManager->SystemAccountManager:++isInputValid(user: UserAccount)++ +group #red Invalid Information #white +Controller.cs<--SystemAccountManager:++return "Invalid input"++ +User<--Controller.cs:++ return "Invalid input"++ +end +Controller.cs<--SystemAccountManager:++return true++ +deactivate SystemAccountManager + // Controller.cs->SystemAccountManager: ++manager.DeleteUserRecord(user:UserAccount)++ @@ -77,22 +93,33 @@ 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)++ +// GetUserName +SystemAccountManager->SystemAccountManager:++string NewUserName()++ +// Enter UserName +User->SystemAccountManager:++string NewUserName++ +// GetPassword +SystemAccountManager->SystemAccountManager:++string NewPassword()++ +// Enter Password +User->SystemAccountManager:++string NewPassword++ +// GetRole +SystemAccountManager->SystemAccountManager:++string NewRole()++ +// Enter Role +User->SystemAccountManager:++string NewRole++ +// Create NewUser object +UserAccount<-SystemAccountManager:++new NewUser(\nstring NewUserName,\nstring NewPassword,\nstring role,\nDateTime TimeStamp)++ +activate UserAccount #CBC3E3 +UserAccount->UserAccount:++Constructor(\nstring NewUserName,\nstring NewPassword,\nstring role,\nDateTime TimeStamp)++ +UserAccount-->SystemAccountManager:++return NewUser++ +deactivate UserAccount +SystemAccountManager->AccountService:++AccountService\n.DeleteUserRecord(user:NewUser,\nUpdateType: userDelete)++ activate AccountService #ff8b3d -AccountService->SqlDAO:++SqlDAO\n.DeleteUserRecord(user:UserAccount)++ +AccountService->SqlDAO:++SqlDAO\n.DeleteUserRecord(user:NewUser,\nUpdateType: userDelete)++ activate SqlDAO #D3D3D3 -SqlDAO->SqlServer(MariaDB): ++isUser(user:UserAccount)++ +SqlDAO->SqlServer(MariaDB):++isUser(user:NewUser)++ activate SqlServer(MariaDB) #00FFFF -SqlServer(MariaDB)->SqlServer(MariaDB):++ Select *\nFrom Users\nwhere Username\n= @UserName OR\nemail = @Email++ +SqlServer(MariaDB)->SqlServer(MariaDB):++Select *\nFrom Users\nwhere Username\n= @UserName and\nRole = @UserRole group #red data store timed out #white SqlDAO<--SqlServer(MariaDB):++SqlException++ deactivate SqlServer(MariaDB) diff --git a/doc/LowLevel/UserManagement/UserManagementDisableUser.pdf b/doc/LowLevel/UserManagement/UserManagementDisableUser.pdf deleted file mode 100644 index b86b934..0000000 Binary files a/doc/LowLevel/UserManagement/UserManagementDisableUser.pdf and /dev/null differ diff --git a/doc/LowLevel/UserManagement/UserManagementDisableUser.png b/doc/LowLevel/UserManagement/UserManagementDisableUser.png index c1580f8..cea8883 100644 Binary files a/doc/LowLevel/UserManagement/UserManagementDisableUser.png and b/doc/LowLevel/UserManagement/UserManagementDisableUser.png differ diff --git a/doc/LowLevel/UserManagement/UserManagementDisableUser.svg b/doc/LowLevel/UserManagement/UserManagementDisableUser.svg deleted file mode 100644 index 40ff29a..0000000 --- a/doc/LowLevel/UserManagement/UserManagementDisableUser.svg +++ /dev/null @@ -1 +0,0 @@ -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 index 0cad143..a9cd10e 100644 --- a/doc/LowLevel/UserManagement/UserManagementDisableUser.txt +++ b/doc/LowLevel/UserManagement/UserManagementDisableUser.txt @@ -37,12 +37,28 @@ SystemAccountManager->SystemAccountManager:++Constructor(IDataSource conn)++ Controller.cs<--SystemAccountManager:++ New SystemAccountManager++ deactivate SystemAccountManager +// GetUserName +Controller.cs->Controller.cs:++string GetUserName()++ + +// GetPassword +Controller.cs->Controller.cs:++string GetPassword()++ + // Pass object -activate UserAccount #CBC3E3 Controller.cs->UserAccount:++ new UserAccount(string username,\n string password\n DateTime RegistrationTimeStamp)++ +activate UserAccount #CBC3E3 UserAccount->UserAccount: ++Constructor(string username,\n string password,\n DateTime RegistrationTimeStamp)++ Controller.cs<--UserAccount:++New UserAccount++ deactivate UserAccount + +activate SystemAccountManager #ffffe0 +SystemAccountManager->SystemAccountManager:++isInputValid(user: UserAccount)++ +group #red Invalid Information #white +Controller.cs<--SystemAccountManager:++return "Invalid input"++ +User<--Controller.cs:++ return "Invalid input"++ +end +Controller.cs<--SystemAccountManager:++return true++ +deactivate SystemAccountManager + // Controller.cs->SystemAccountManager: ++manager.DisableUserRecord(user:UserAccount)++ @@ -77,23 +93,30 @@ 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)++ +// GetUserName +SystemAccountManager->SystemAccountManager:++string NewUserName()++ +// Enter UserName +User->SystemAccountManager:++string NewUserName++ +// GetRole +SystemAccountManager->SystemAccountManager:++string NewRole()++ +// Enter Role +User->SystemAccountManager:++string NewRole++ +// Create NewUser object +UserAccount<-SystemAccountManager:++new NewUser(\nstring NewUserName,\nstring role,\nDateTime TimeStamp)++ +activate UserAccount #CBC3E3 +UserAccount->UserAccount:++Constructor(\nstring NewUserName,\nstring role,\nDateTime TimeStamp)++ +UserAccount-->SystemAccountManager:++return NewUser++ +deactivate UserAccount +SystemAccountManager->AccountService:++AccountService\n.DisableUserRecord(user:NewUser,\nUpdateType:userDisable)++ activate AccountService #ff8b3d -AccountService->SqlDAO:++SqlDAO\n.DisableUser(user:UserAccount)++ +AccountService->SqlDAO:++SqlDAO\n.DisableUser(user:NewUser,\nUpdateType:userDisable)++ activate SqlDAO #D3D3D3 -SqlDAO->SqlServer(MariaDB): ++isUser(user:UserAccount)++ +SqlDAO->SqlServer(MariaDB):++isUser(user:NewUser)++ activate SqlServer(MariaDB) #00FFFF -SqlServer(MariaDB)->SqlServer(MariaDB):++ Select *\nFrom Users\nwhere Username\n= @UserName OR\nemail = @Email++ +SqlServer(MariaDB)->SqlServer(MariaDB):++ Select *\nFrom Users\nwhere Username\n= @UserName and\nRole = @UserRole\n group #red data store timed out #white SqlDAO<--SqlServer(MariaDB):++SqlException++ deactivate SqlServer(MariaDB) @@ -111,24 +134,24 @@ activate SqlServer(MariaDB) #00FFFF SqlDAO<--SqlServer(MariaDB):++ return True++ SqlDAO->SqlServer(MariaDB):++Update users Set isActive = 0\nwhere UserName = @UserName++ SqlDAO<--SqlServer(MariaDB):++ return 1++ +deactivate SqlServer(MariaDB) AccountService<--SqlDAO:++return "User is now disabled"++ SystemAccountManager<--AccountService:++return "User is now disabled"++ Controller.cs<--SystemAccountManager:++return "User is now disabled"++ User<--Controller.cs:++ return \n"User is now disabled"++ -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) +AccountService<--SqlDAO:++return "User does not exist"++ +deactivate SqlDAO +SystemAccountManager<--AccountService:++return "User does not exist"++ +deactivate AccountService +Controller.cs<--SystemAccountManager:++return "User does not exist"++ deactivate SystemAccountManager +User<--Controller.cs:++ return \n"User does not exist"++ deactivate Controller.cs end //deactivate User diff --git a/doc/LowLevel/UserManagement/UserManagementEditUserRecords.pdf b/doc/LowLevel/UserManagement/UserManagementEditUserRecords.pdf deleted file mode 100644 index 7886dc1..0000000 Binary files a/doc/LowLevel/UserManagement/UserManagementEditUserRecords.pdf and /dev/null differ diff --git a/doc/LowLevel/UserManagement/UserManagementEditUserRecords.png b/doc/LowLevel/UserManagement/UserManagementEditUserRecords.png index 07c3ea7..4be1359 100644 Binary files a/doc/LowLevel/UserManagement/UserManagementEditUserRecords.png and b/doc/LowLevel/UserManagement/UserManagementEditUserRecords.png differ diff --git a/doc/LowLevel/UserManagement/UserManagementEditUserRecords.svg b/doc/LowLevel/UserManagement/UserManagementEditUserRecords.svg deleted file mode 100644 index a2a1fac..0000000 --- a/doc/LowLevel/UserManagement/UserManagementEditUserRecords.svg +++ /dev/null @@ -1 +0,0 @@ -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 index 68e50a3..d35b4e9 100644 --- a/doc/LowLevel/UserManagement/UserManagementEditUserRecords.txt +++ b/doc/LowLevel/UserManagement/UserManagementEditUserRecords.txt @@ -23,7 +23,7 @@ Controller.cs->SqlDAO:++IDataSource factory.GetDataSource(string DbName, string activate SqlDAO #D3D3D3 SqlDAO->SqlDAO:++Constructor(string connInfo)++ group #red Data Store Timed Out #white -SqlDAO->SqlDAO: ++Catch SqlException++ +SqlDAO->SqlDAO: ++Catch Exception++ Controller.cs<--SqlDAO:++return "Data Source Timed Out"++ end group #blue Data Store Online #white @@ -37,14 +37,30 @@ SystemAccountManager->SystemAccountManager:++Constructor(IDataSource conn)++ Controller.cs<--SystemAccountManager:++ New SystemAccountManager++ deactivate SystemAccountManager +// GetUserName +Controller.cs->Controller.cs:++string GetUserName()++ + +// GetPassword +Controller.cs->Controller.cs:++string GetPassword()++ + // + +Controller.cs->UserAccount:++ new UserAccount(string username,\n string password,\n DateTime RegistrationTimeStamp)++ activate UserAccount #CBC3E3 -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++ +UserAccount->UserAccount: ++string username,\n string password,\n DateTime RegistrationTimeStamp++ Controller.cs<--UserAccount:++New UserAccount++ deactivate UserAccount +activate SystemAccountManager #ffffe0 +SystemAccountManager->SystemAccountManager:++isInputValid(user: UserAccount)++ +group #red Invalid Information #white +Controller.cs<--SystemAccountManager:++return "Invalid input"++ +User<--Controller.cs:++ return "Invalid input"++ +end +Controller.cs<--SystemAccountManager:++return true++ +deactivate SystemAccountManager + //look over -Controller.cs->SystemAccountManager: ++manager.UpdateUserRecord(user:UserAccount,\nActiveUser:user, UpdateObj: userUpdate)++ +Controller.cs->SystemAccountManager:++manager.UpdateUserRecord(user:UserAccount)++ //check if there is an admin user activate SystemAccountManager #ffffe0 @@ -78,22 +94,37 @@ 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)++ +// GetUserName +SystemAccountManager->SystemAccountManager:++string NewUserName()++ +// Enter UserName +User->SystemAccountManager:++string NewUserName++ +// GetPassword +SystemAccountManager->SystemAccountManager:++string NewPassword()++ +// Enter Password +User->SystemAccountManager:++string NewPassword++ +// GetEmail +SystemAccountManager->SystemAccountManager:++string NewEmail()++ +// Enter Email +User->SystemAccountManager:++string NewEmail++ +// GetRole +SystemAccountManager->SystemAccountManager:++string NewRole()++ +// Enter Role +User->SystemAccountManager:++string NewRole++ +// Create NewUser object +UserAccount<-SystemAccountManager:++new NewUser(\nstring NewUserName,\nstring NewPassword,\nstring New Email,\nstring NewRole,\nDateTime TimeStamp)++ +activate UserAccount #CBC3E3 +UserAccount->UserAccount:++Constructor(\nstring NewUserName,\nstring NewPassword,\nstring New Email,\nstring NewRole,\nDateTime TimeStamp)++ +UserAccount-->SystemAccountManager:++return NewUser++ +deactivate UserAccount +SystemAccountManager->AccountService:++AccountService\n.UpdateUserRecord(user:NewUser,\nUpdateType: userUpdate)++ activate AccountService #ff8b3d -AccountService->SqlDAO: ++SqlDAO\n.CreateUserRecord(user:UserAccount\n,ActiveUser:user, UpdateObj: userUpdate)++ +AccountService->SqlDAO:++SqlDAO\n.UpdateUserRecord(user:NewUser,\nUpdateType: userUpdate)++ activate SqlDAO #D3D3D3 -SqlDAO->SqlServer(MariaDB): ++isUser(user:UserAccount)++ +SqlDAO->SqlServer(MariaDB):++isUser(user:NewUser)++ activate SqlServer(MariaDB) #00FFFF -SqlServer(MariaDB)->SqlServer(MariaDB):++ Select *\nFrom Users\nwhere Username\n= @UserName OR\nemail = @Email++ +SqlServer(MariaDB)->SqlServer(MariaDB):++Update *\nFrom Users\nwhere Username\n= @UserName and\nRole = @UserRole group #red data store timed out #white SqlDAO<--SqlServer(MariaDB):++SqlException++ deactivate SqlServer(MariaDB) @@ -109,13 +140,13 @@ group #blue data store is online #white 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):++ SQL insert\nupdate credentials++ SqlDAO<--SqlServer(MariaDB):++ return 1++ +deactivate SqlServer(MariaDB) AccountService<--SqlDAO:++return "User information updated successfully"++ SystemAccountManager<--AccountService:++return "User information updated successfully"++ Controller.cs<--SystemAccountManager:++return "User information updated successfully"++ User<--Controller.cs:++ return "User information\n updated successfully"++ -deactivate SqlServer(MariaDB) end // User doesn't exist group #green User does not exist #white @@ -123,14 +154,14 @@ 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) +AccountService<--SqlDAO:++return "User is now registered"++ +deactivate SqlDAO +SystemAccountManager<--AccountService:++return "User is now registered"++ +deactivate AccountService +Controller.cs<--SystemAccountManager:++return "User is now registered"++ deactivate SystemAccountManager +User<--Controller.cs:++ return \n"User is now registered"++ deactivate Controller.cs end //deactivate User diff --git a/doc/LowLevel/UserManagement/UserManagementEnableUser.png b/doc/LowLevel/UserManagement/UserManagementEnableUser.png new file mode 100644 index 0000000..ccfa2fb Binary files /dev/null and b/doc/LowLevel/UserManagement/UserManagementEnableUser.png differ diff --git a/doc/LowLevel/UserManagement/UserManagementEnableUser.txt b/doc/LowLevel/UserManagement/UserManagementEnableUser.txt new file mode 100644 index 0000000..71b32f4 --- /dev/null +++ b/doc/LowLevel/UserManagement/UserManagementEnableUser.txt @@ -0,0 +1,161 @@ +title Enable Specfied User +actor User +participant Controller.cs #90EE90 +participant RDSFactory #26abff +participant UserAccount #CBC3E3 +participant SystemAccountManager #ffffe0 +participant AccountService #ff8b3d +participant SqlDAO #D3D3D3 +//SqlDAO +database SqlServer(MariaDB) #00FFFF + +//activate User +activate Controller.cs #90EE90 +User->Controller.cs: ++Request to enable user\n by a different user++ + +//RelatDSFactory +Controller.cs->RDSFactory:++factory = new RDSFactory()++ +activate RDSFactory #26abff +RDSFactory->RDSFactory:++Constructor()++ +Controller.cs<--RDSFactory:++return RDSFactory++ +deactivate RDSFactory +Controller.cs->SqlDAO:++IDataSource factory.GetDataSource(string DbName, string connInfo)++ +activate SqlDAO #D3D3D3 +SqlDAO->SqlDAO:++Constructor(string connInfo)++ +group #red Data Store Timed Out #white +SqlDAO->SqlDAO: ++Catch SqlException++ +Controller.cs<--SqlDAO:++return "Data Source Timed Out"++ +end +group #blue Data Store Online #white +Controller.cs<--SqlDAO: ++return SqlDAO++ +deactivate SqlDAO + +// Create new Admin +Controller.cs->SystemAccountManager:++ manager = new SystemAccountManager(IDataSource conn)++ +activate SystemAccountManager #ffffe0 +SystemAccountManager->SystemAccountManager:++Constructor(IDataSource conn)++ +Controller.cs<--SystemAccountManager:++ New SystemAccountManager++ +deactivate SystemAccountManager + +// GetUserName +Controller.cs->Controller.cs:++string GetUserName()++ + +// GetPassword +Controller.cs->Controller.cs:++string GetPassword()++ + +// Pass object +Controller.cs->UserAccount:++ new UserAccount(string username,\n string password\n DateTime RegistrationTimeStamp)++ +activate UserAccount #CBC3E3 +UserAccount->UserAccount: ++Constructor(string username,\n string password,\n DateTime RegistrationTimeStamp)++ +Controller.cs<--UserAccount:++New UserAccount++ +deactivate UserAccount + +activate SystemAccountManager #ffffe0 +SystemAccountManager->SystemAccountManager:++isInputValid(user: UserAccount)++ +group #red Invalid Information #white +Controller.cs<--SystemAccountManager:++return "Invalid input"++ +User<--Controller.cs:++ return "Invalid input"++ +end +Controller.cs<--SystemAccountManager:++return true++ +deactivate SystemAccountManager + +// +Controller.cs->SystemAccountManager:++manager.EnableUserRecord(user:UserAccount)++ + +//check if there is an admin user +activate SystemAccountManager #ffffe0 +SystemAccountManager->SqlDAO:++isAdmin(user:UserAccount)++ +activate SqlDAO #D3D3D3 +SqlDAO->SqlServer(MariaDB):++SqlRead confirmAdmin()++ +activate SqlServer(MariaDB)#00FFFF +SqlServer(MariaDB)->SqlServer(MariaDB):++Select * from Admins\n where Username = @UserName \nand Password = @Pwd++ +//Unauthorized role section +group #red Unauthorized User #white +SqlDAO<--SqlServer(MariaDB):++SqlException++ +SqlDAO->SqlDAO: ++Catch\nSqlException++ +SystemAccountManager<--SqlDAO:++return false++ +Controller.cs<--SystemAccountManager:++ return "Access Denied: \nUnauthorized"++ +User<--Controller.cs:++return "Access Denied: \nUnauthorized"++ +//Unauthorized role section +end +group #red Unauthorized User #white +SqlDAO<--SqlServer(MariaDB):++return false++ +SystemAccountManager<--SqlDAO:++return false++ +Controller.cs<--SystemAccountManager:++ return "Access Denied: \nUnauthorized"++ +User<--Controller.cs:++return "Access Denied: \nUnauthorized"++ +end + + +//Authorized role section +group #blue Authorized User #white +SqlDAO<--SqlServer(MariaDB):++return true++ +deactivate SqlServer(MariaDB) +SystemAccountManager<--SqlDAO:++return true++ +deactivate SqlDAO +deactivate SystemAccountManager + +group #green Valid Information #white +activate SystemAccountManager #ffffe0 +// GetUserName +SystemAccountManager->SystemAccountManager:++string NewUserName()++ +// Enter UserName +User->SystemAccountManager:++string NewUserName++ +// GetRole +SystemAccountManager->SystemAccountManager:++string NewRole()++ +// Enter Role +User->SystemAccountManager:++string NewRole++ +// Create NewUser object +UserAccount<-SystemAccountManager:++new NewUser(\nstring NewUserName,\nstring role,\nDateTime TimeStamp)++ +activate UserAccount #CBC3E3 +UserAccount->UserAccount:++Constructor(\nstring NewUserName,\nstring role,\nDateTime TimeStamp)++ +UserAccount-->SystemAccountManager:++return NewUser++ +deactivate UserAccount +SystemAccountManager->AccountService:++AccountService\n.EnableUserRecord(user:NewUser,\nUpdateType:userEnable)++ +activate AccountService #ff8b3d +AccountService->SqlDAO:++SqlDAO\n.EnableUser(user:NewUser,\nUpdateType:userEnable)++ +activate SqlDAO #D3D3D3 +SqlDAO->SqlServer(MariaDB):++isUser(user:NewUser)++ +activate SqlServer(MariaDB) #00FFFF +SqlServer(MariaDB)->SqlServer(MariaDB):++ Select *\nFrom Users\nwhere Username\n= @UserName and\nRole = @UserRole +group #red data store timed out #white +SqlDAO<--SqlServer(MariaDB):++SqlException++ +deactivate SqlServer(MariaDB) +SqlDAO->SqlDAO: ++Catch\nSqlException++ +AccountService<--SqlDAO:++return "Database timed out"++ + +SystemAccountManager<--AccountService:++ return "Database timed out"++ +Controller.cs<--SystemAccountManager:++ return "Database timed out"++ +User<--Controller.cs:++ return "Database timed out"++ +end +group #blue data store is online #white +// User exists +group #green User does exist #white +activate SqlServer(MariaDB) #00FFFF +SqlDAO<--SqlServer(MariaDB):++ return True++ +SqlDAO->SqlServer(MariaDB):++Update users Set isActive = 1\nwhere UserName = @UserName++ +SqlDAO<--SqlServer(MariaDB):++ return 1++ +deactivate SqlServer(MariaDB) +AccountService<--SqlDAO:++return "User is now enabled"++ +SystemAccountManager<--AccountService:++return "User is now enabled"++ +Controller.cs<--SystemAccountManager:++return "User is now enabled"++ +User<--Controller.cs:++ return \n"User is now enabled"++ +end +// User doesn't exist +group #red User does not exist #white +activate SqlServer(MariaDB) #00FFFF +SqlDAO<--SqlServer(MariaDB):++ return False++ +deactivate SqlServer(MariaDB) +AccountService<--SqlDAO:++return "User does not exist"++ +deactivate SqlDAO +SystemAccountManager<--AccountService:++return "User does not exist"++ +deactivate AccountService +Controller.cs<--SystemAccountManager:++return "User does not exist"++ +deactivate SystemAccountManager +User<--Controller.cs:++ return \n"User does not exist"++ +deactivate Controller.cs +end +//deactivate User +end +end +end +end \ No newline at end of file