Duties and Privileges of users

while select taskEntryPoint
join subTask where subTask.SecuritySubTask == taskEntryPoint.SecurityTask
join taskGrant where taskGrant.SecurityTask == subTask.SecurityTask
join role where role.RecId == taskGrant.SecurityRole
exists join userRole where userRole.SecurityRole == role.RecId
&& userRole.User == curUserId()
&& userRole.AssignmentStatus == RoleAssignmentStatus::Enabled

Using this code iam getting the duties and privileges of current user only but i need all the users present in securityuserRole table

You explicitly tell the database to return data for the current user: && userRole.User == curUserId(). Remove it if you don’t want it.