I copied this from Victoria Yudin's blog, because it's too important to not to be able to find again. If you work on/in/under Dynamics GP, you need to subscribe to this.
CREATE VIEW view_Security_Details
AS
/**
view_Security_Details
Created Mar 20 2009 by Victoria Yudin - Flexible Solutions, Inc.
For updates see <a href="http://victoriayudin.com/gp-reports/">http://victoriayudin.com/gp-reports/</a>
Shows all security roles, tasks and detailed resource descriptions
by user by company
**/
SELECT DISTINCT
S.USERID UserID, S.CMPANYID CompanyID,
C.CMPNYNAM CompanyName, S.SecurityRoleID,
coalesce(T.SECURITYTASKID,'') SecurityTaskID,
coalesce(TM.SECURITYTASKNAME,'') SecurityTaskName,
coalesce(TM.SECURITYTASKDESC,'') SecurityTaskDescription,
coalesce(R.DICTID,'') DictionaryID,
coalesce(R.PRODNAME,'') ProductName,
coalesce(R.TYPESTR,'') ResourceType,
coalesce(R.DSPLNAME,'') ResourceDisplayName,
coalesce(R.RESTECHNAME,'') ResourceTechnicalName,
coalesce(R.Series_Name,'') ResourceSeries
FROM SY10500 S -- security assignment user role
LEFT OUTER JOIN
SY01500 C -- company master
ON S.CMPANYID = C.CMPANYID
LEFT OUTER JOIN
SY10600 T -- tasks in roles
ON S.SECURITYROLEID = T.SECURITYROLEID
LEFT OUTER JOIN
SY09000 TM -- tasks master
ON T.SECURITYTASKID = TM.SECURITYTASKID
LEFT OUTER JOIN
SY10700 O -- operations in tasks
ON T.SECURITYTASKID = O.SECURITYTASKID
LEFT OUTER JOIN
SY09400 R -- resource descriptions
ON R.DICTID = O.DICTID AND O.SECRESTYPE = R.SECRESTYPE
AND O.SECURITYID = R.SECURITYID
/** the following will grant permissions to this view to DYNGRP,
leave this section off if you do not want to grant permissions **/
GO
GRANT SELECT ON view_Security_Details TO DYNGRP