added wrapper function for process:interact to control access
This commit is contained in:
parent
76db1ea87f
commit
512ed2ecd4
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user