User Report that shows each user and their access (role)
We need to have a report that can be run to show all of our users and the role they are assigned to: Global Admin, Country Admin, Location Admin, User, Group Admin, Video Administrator.
When this information was requested to Condeco Support the response was their would be a charge. We should not be charged for a report we can not run on own if we had access to the data via a report.
-
Peter Scobbie
commented
WITH
Countries
AS
(
SELECT DBO.TBLCOUNTRY.PKCOUNTRYID,
DBO.TBLTRANSLATE.TEXT AS COUNTRYNAME
FROM DBO.TBLCOUNTRY
INNER JOIN DBO.TBLTRANSLATE ON
DBO.TBLCOUNTRY.FKTOKENID = DBO.TBLTRANSLATE.FKTOKENID
WHERE DBO.TBLCOUNTRY.ACTIVE = 1
AND DBO.TBLCOUNTRY.PKCOUNTRYID != 2
),
UserPermissions
AS
(
SELECT DISTINCT u.UserName,
LTRIM(RTRIM(u.FirstName)) + ' ' + LTRIM(RTRIM(u.LastName)) AS FullName,
u.Email,
u.Telephone,
CASE u.fkAccessLevelID
WHEN 1 THEN 'Global Admin'
WHEN 2 THEN 'Country Admin'
WHEN 3 THEN 'Location Admin'
WHEN 4 THEN 'User'
WHEN 5 THEN 'Group Admin'
WHEN 6 THEN 'Vendor'
WHEN 9 THEN 'Video Admin'
END AS UserRole,
c.COUNTRYNAME AS DefaultUserCountry,
lc.LocationName,
bu.BusinessUnitName AS PermissionGroup,
iu.locationVisible As LocationVisible,
CASE
WHEN iu.makeBookings IS NULL THEN bu.makeBookings
ELSE iu.makeBookings
END AS MakeBookings,
CASE
WHEN iu.viewOthersBookings IS NULL THEN bu.viewOthers
ELSE iu.viewOthersBookings
END AS ViewOthersBookings,
CASE
WHEN iu.editOthersBookings IS NULL THEN bu.editOthers
ELSE iu.editOthersBookings
END AS EditOthersBookings,
CASE
WHEN iu.deleteOthersBookings IS NULL THEN bu.deleteOthers
ELSE iu.deleteOthersBookings
END AS DeleteOthersBookings
FROM tblInternalUser AS iu
INNER JOIN tblUser AS u
ON iu.fkUserID = u.pkUserID
INNER JOIN tblBusinessUnit AS bu
ON iu.fkBusinessUnitID = bu.pkBusinessUnitID
INNER JOIN tblLocation AS lc
ON iu.fkLocationID = lc.pkLocationID
INNER JOIN Countries AS c
ON u.fkCountryID = c.pkCountryID
)SELECT UserPermissions.UserName,
UserPermissions.FullName,
UserPermissions.Email,
UserPermissions.Telephone,
UserPermissions.UserRole,
UserPermissions.DefaultUserCountry,
UserPermissions.LocationName,
UserPermissions.PermissionGroup,
CASE UserPermissions.LocationVisible
WHEN 0 THEN 'No'
ELSE 'Yes'
END AS LocationVisible,
CASE UserPermissions.MakeBookings
WHEN 0 THEN 'No'
ELSE 'Yes'
END AS MakeBookings,
CASE UserPermissions.ViewOthersBookings
WHEN 0 THEN 'No'
ELSE 'Yes'
END AS ViewOthers,
CASE UserPermissions.EditOthersBookings
WHEN 0 THEN 'No'
ELSE 'Yes'
END AS EditOthers,
CASE UserPermissions.DeleteOthersBookings
WHEN 0 THEN 'No'
ELSE 'Yes'
END AS DeleteOthers
FROM UserPermissionsGet support to run this SQL script on the DB (If you are on the latest version of Condeco Enterprise) and dump the output into Excel for you.