Hi,I'm trying to give a specific user Content Manager permissions with the script below. Although it appears that all entries are present in the dbo.PolicyUserRole table, the changes don't show up in the Report Manager. I have to manually enter the user into Report Manager to make it work even though the only difference between scripting and entering it manually is the PolicyUserRole.ID field since it's chosen randomly (all other fields are the identical). Any idea as to why my script won't work and if this is even possible?Declare @RoleID uniqueidentifier;Declare @UserID uniqueidentifier;SET @RoleID = (Select RoleID From dbo.Roles Where RoleName = 'Content Manager');SET @UserID = (Select UserID From dbo.Users Where UserName = 'DOMAIN\USERNAME');INSERT dbo.PolicyUserRole (ID, RoleID, UserID, PolicyID)Select NEWID(), RoleId, UserId, PolicyIDFROM(Select DISTINCT @RoleID AS RoleId, @UserID AS UserId, C.PolicyIDfrom dbo.Catalog C Where C.ItemID NOT IN ( Select C1.ItemID From dbo.Catalog C1 inner join dbo.PolicyUserRole P ON C1.PolicyID = P.PolicyID Where P.UserID = @UserID)) AS Query;
↧