added wrapper function for process:interact to control access

This commit is contained in:
Luke Miller 2021-08-20 01:18:02 -04:00
parent 76db1ea87f
commit 512ed2ecd4

View File

@ -255,3 +255,18 @@ function modpol.orgs:make_request(request)
return process_id
end
-- wrapper for process:interact function, ensures that user actually has a pending action for that process
function modpol.orgs:interact(process_id, user)
process = self.processes[process_id]
if self.pending[user] then
if self.pending[user][process_id] == true then
process:interact(user)
else
modpol.ocutil.log("Cannot interact with process, user does not have a valid pending action")
end
else
modpol.ocutil.log("Cannot interact with process, user does not have any pending actions")
end
end