3 Replies Latest reply on Oct 24, 2013 11:09 AM by Charley Saint

    How to check files permission for user

    James Lee

      Hi Guys,

       

      Is there a way to check user files permission? Currently, I have to login to EPDM for each user, select each file and right click properties to check the file permission (as attached).

       

      Is there a way to check the permission of all the files instead of choosing one by one to see the permission?

       

      Can I set all the files permission at one time?

       

      Thanks in advance!

        • Re: How to check files permission for user
          Charley Saint

          --Updated--

           

          James,

           

          Here's a query you can run that dumps it out in a nice format, I've also attached a crp file with the same results. As far as I know you can't set these permissions on multiple files at the same time, most people don't even use these.

           

          DECLARE @idList varchar(MAX)

          select @idList = COALESCE(@idList + ',', '') + '[' + GroupName + ']'

          FROM (select distinct groupname from

          FilePermissions fp

          inner join GroupS g on g.GroupID = fp.GroupID) a

           

          DECLARE @replaceList varchar(MAX)

          select @replaceList = COALESCE(@replaceList + ',', '') + 'replace(replace([' + GroupName + '],''1'',''X''),''0'','''') ['+ GroupName + ']'

          FROM (select distinct groupname from

          FilePermissions fp

          inner join GroupS g on g.GroupID = fp.GroupID) a

           

          DECLARE @sqlToRun varchar(MAX)

          SET @sqlToRun = '

          select filename, ' + @replaceList + ' from

          (SELECT filename, g.Groupname from

          documents d

          inner join FilePermissions fp on d.DocumentID = fp.DocumentID

          inner join GroupS g on g.GroupID = fp.GroupID)a

          pivot

          (

          count(groupname)

          for groupname in (' + @idList + ')

          ) as pvt'

           

          EXEC (@sqlToRun)

           

          Message was edited by: Charley Saint