The fourth view being posted in this series takes a step back from the users and just shows the role and tasks within.
CREATE VIEW [dbo].[uv_AZRCRV_SecurityRolesWithTasks] AS
/*
Created by Ian Grieve of azurecurve|Ramblings of a Dynamics GP Consultant (https://www.azurecurve.co.uk)
This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales (CC BY-NC-SA 2.0 UK).
*/
SELECT
['Security Roles Master'].SECURITYROLEID AS 'Security Role ID'
,['Security Roles Master'].SECURITYROLENAME AS 'Security Role Name'
,['Security Role Task Assignment'].SECURITYTASKID AS 'Security Task ID'
,['Security Task Master'].SECURITYTASKNAME AS 'Security Task Name'
FROM
SY09100 AS ['Security Roles Master']
INNER JOIN
SY10600 AS ['Security Role Task Assignment']
ON ['Security Role Task Assignment'].SECURITYROLEID = ['Security Roles Master'].SECURITYROLEID
INNER JOIN
SY09000 AS ['Security Task Master']
ON ['Security Task Master'].SECURITYTASKID = ['Security Role Task Assignment'].SECURITYTASKID
GO
GRANT SELECT ON uv_AZRCRV_SecurityRolesWithTasks TO DYNGRP
GO