updated create account
need to update rest, text file added
This commit is contained in:
parent
27dc15577e
commit
3797701563
Binary file not shown.
BIN
doc/LowLevel/UserManagement/User Management_ Create Account.png
Normal file
BIN
doc/LowLevel/UserManagement/User Management_ Create Account.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 721 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 134 KiB |
140
doc/LowLevel/UserManagement/User Management_ Create Account.txt
Normal file
140
doc/LowLevel/UserManagement/User Management_ Create Account.txt
Normal file
@ -0,0 +1,140 @@
|
||||
title Create User Record
|
||||
actor User
|
||||
participant Controller.cs #90EE90
|
||||
participant RDSFactory #26abff
|
||||
participant UserAccount #CBC3E3
|
||||
participant SystemAccountManager #ffffe0
|
||||
participant AccountService #ff8b3d
|
||||
participant SqlDAO #D3D3D3
|
||||
//SqlDAO
|
||||
database SqlServer(MariaDB) #00FFFF
|
||||
|
||||
//activate User
|
||||
activate Controller.cs #90EE90
|
||||
User->Controller.cs: ++Create new User++
|
||||
|
||||
//RelatDSFactory
|
||||
Controller.cs->RDSFactory:++factory = new RDSFactory()++
|
||||
activate RDSFactory #26abff
|
||||
RDSFactory->RDSFactory:++Constructor()++
|
||||
Controller.cs<--RDSFactory:++return RDSFactory++
|
||||
deactivate RDSFactory
|
||||
Controller.cs->SqlDAO: ++IDataSource factory.GetDataSource(string name, 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: ++Constructor(string username,\n string password,\n string email,\n DateTime RegistrationTimeStamp)++
|
||||
Controller.cs<--UserAccount:++New UserAccount++
|
||||
deactivate UserAccount
|
||||
//
|
||||
Controller.cs->SystemAccountManager:++manager.CreateUserRecord(user:UserAccount)++
|
||||
|
||||
//check if there is an admin user
|
||||
activate SystemAccountManager #ffffe0
|
||||
SystemAccountManager->SqlDAO:++bool isAdmin(user:UserAccount)++
|
||||
activate SqlDAO #D3D3D3
|
||||
SqlDAO->SqlServer(MariaDB):++SqlRead confirmAdmin()++
|
||||
activate SqlServer(MariaDB)#00FFFF
|
||||
//authorized
|
||||
SqlServer(MariaDB)->SqlServer(MariaDB):++Select * from Admins\n where Username = @UserName \nand Password = @Pwd++
|
||||
//Unauthorized role section
|
||||
group #red Unauthorized User #white
|
||||
SqlDAO<--SqlServer(MariaDB):++SqlException++
|
||||
SqlDAO->SqlDAO: ++Catch\nSqlException++
|
||||
SystemAccountManager<--SqlDAO:++return false++
|
||||
Controller.cs<--SystemAccountManager:++ return "Access Denied: \nUnauthorized"++
|
||||
User<--Controller.cs:++return "Access Denied: \nUnauthorized"++
|
||||
end
|
||||
//Unauthorized role section
|
||||
group #red Unauthorized User #white
|
||||
SqlDAO<--SqlServer(MariaDB):++return false++
|
||||
SystemAccountManager<--SqlDAO:++return false++
|
||||
Controller.cs<--SystemAccountManager:++ return "Access Denied: \nUnauthorized"++
|
||||
User<--Controller.cs:++return "Access Denied: \nUnauthorized"++
|
||||
end
|
||||
|
||||
|
||||
//Authorized role section
|
||||
group #blue Authorized User #white
|
||||
SqlDAO<--SqlServer(MariaDB):++return true++
|
||||
deactivate SqlServer(MariaDB)
|
||||
SystemAccountManager<--SqlDAO:++return true++
|
||||
deactivate SqlDAO
|
||||
deactivate SystemAccountManager
|
||||
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.CreateUserRecord(user:UserAccount)++
|
||||
activate AccountService #ff8b3d
|
||||
AccountService->SqlDAO:++SqlDAO\n.CreateUserRecord(user:UserAccount)++
|
||||
activate SqlDAO #D3D3D3
|
||||
SqlDAO->SqlServer(MariaDB):++SqlRead \nisUser(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++
|
||||
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
|
||||
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
|
||||
end
|
||||
Loading…
Reference in New Issue
Block a user