Commit 19da10d4 authored by ecrombag's avatar ecrombag

Fix in WorkflowService. Workflows without any required roles did not show in...

Fix in WorkflowService. Workflows without any required roles did not show in case of a 'RegisteredUser'

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@1112 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent b3dbb2dd
......@@ -28,7 +28,7 @@ workflowService url html path req tst
// List available flows
# (session,tst) = getCurrentSession tst
# (workflows,tst) = getWorkflows tst
# items = workflowItems path (session.Session.user) workflows
# items = workflowItems path (session.Session.user) workflows
# json = JSONObject [("success",JSONBool True),("workflows",toJSON items)]
= (serviceResponse html "workflows" url params json, tst)
where
......@@ -41,7 +41,7 @@ where
//Allow the root user
isAllowed RootUser _ = True
//Allow workflows for which the user has permission
isAllowed (RegisteredUser details) wf = or [isMember role (mb2list details.UserDetails.roles) \\ role <- wf.Workflow.roles]
isAllowed (RegisteredUser details) wf = or [isMember role (mb2list details.UserDetails.roles) \\ role <- wf.Workflow.roles] || isEmpty wf.Workflow.roles
//Allow workflows without required roles
isAllowed _ wf = isEmpty wf.Workflow.roles
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment