Algorithm 3 and Function |
-
Input:
userID, dataOwner, dataType
-
Output:
false, Data
-
1:
Retrieves user information from UserManagement using userID
-
2:
if user exists then
-
3:
Update userSessions with isLoggedIn, role, and department
-
4:
Check access permissions from PC
-
5:
if access is granted then
-
6:
return result from (dataOwner, dataType)
-
7:
else
-
8:
emit (msg.sender, “Access denied for the requested data type.”)
-
9:
return false
-
10:
end if
-
11:
else
-
12:
Emit event with the reason of “User does not exist.”
-
13:
return false
-
14:
end if
|