The tables involved in security:
• DYNAMICS..SY10500 – Security Assignment User Role (Main Table)
• DYNAMICS..SY01500 – Company Master
• DYNAMICS..SY01400 – Users Master
• DYNAMICS..SY09100 – Security Roles Master
• DYNAMICS..SY10600 – Security Assignment Role Task
• DYNAMICS..SY09000 – Security Tasks Master
SELECT
S.SecurityRoleID,
coalesce(T.SECURITYTASKID,'') SecurityTaskID,
coalesce(TM.SECURITYTASKNAME,'') SecurityTaskName,
coalesce(TM.SECURITYTASKDESC,'') SecurityTaskDescription,
S.USERID UserID,
S.CMPANYID CompanyID,
C.CMPNYNAM CompanyName
FROM SY10500 S -- security assignment user role
LEFT JOIN SY01500 C ON S.CMPANYID = C.CMPANYID
-- tasks in roles
LEFT JOIN SY10600 T ON S.SECURITYROLEID = T.SECURITYROLEID
-- tasks master
LEFT JOIN SY09000 TM ON T.SECURITYTASKID = TM.SECURITYTASKID
order by 1,2