Quantcast
Channel: Symantec Connect - Endpoint Management - Articles
Viewing all articles
Browse latest Browse all 706

How to find out a Security Roles assigned permissions and privileges

$
0
0

As the 7.1.2 MP1.1 v7RU Console does not contain any reports that display this information, the following two queries will help you achieve this goal:

 

-- display all privileges associated with one (or more) security roles.

declare @my_role varchar(max)
-- set @my_role='%Security Role%'
set @my_role='symantec admin%'

    select vsr.name [Role],
        v5.name [Solution], spdg.NameRef [Privilege Type], sp.Name [Privilege]
        -- , st.Trustee
    from SecurityRole vsr
        left join SecurityPrivilegeTrustee spt on spt.TrusteeGuid = vsr.TrusteeGuid
        left join securityprivilege sp on sp.guid = spt.PrivilegeGuid
        left join securityprivilegedisplaygroup  spdg on spdg.guid = sp.DisplayGroupGuid
        left join vitem v5 on v5.guid = spdg.Solution
        -- left join SecurityTrustee st on st.guid = vsr.TrusteeGuid
    where vsr.name like @my_role
    order by [Role], [Solution], [Privilege Type], [Privilege]

 

 

-- for a given security role
-- display all the non-inherited security permissions.

declare @my_role varchar(max)
-- set @my_role = '%Security_Role%'
set @my_role = 'symantec admin%'

    declare @c1 table (
        zRole varchar(max),
        zGroup varchar(max),
        zPerm varchar(max),
        zInherited int,
        zguid uniqueidentifier,
        zItemName varchar (max),
        zClassName varchar (max),
        zParentGuid uniqueidentifier
        )

    -- get all the "easy" stuff abou each item.
    insert into @c1
    select sr.Name, spdg.NameRef , sp.name,
        sa.Inherited,  sa.Entityguid,
        v1.name, c.Type, vif.ParentFolderGuid
    from
        SecurityRole sr
        left join SecurityTrusteePermission stp on stp.TrusteeGuid = sr.TrusteeGuid    
        left join SecurityPermission sp on sp.guid = stp.PermissionGuid
        left join SecurityPermissionDisplayGroup spdg on spdg.guid = sp.DisplayGroupGuid
        join SecurityACENonResource sa ON sa.TrusteePermissionId = stp.[Id]
        left join vitem v1 on v1.guid=sa.Entityguid
        left join class c on c.guid = v1.ClassGuid
        left join vItemFolder vif on vif.ItemGuid = sa.Entityguid
    where sr.name like @my_role
        and sa.Inherited = 0

    -- select * from @c1 c1

    -- now include the path to the item, this is faster after limiting to just non-inherited permissions
    select
        c1.zRole [Role],
        (SELECT v2.name + '; '
        FROM FolderBaseFolder fbf
            left join vitem v2 on v2.guid=fbf.ParentFolderGuid
        WHERE fbf.FolderGuid = c1.zParentGuid
            and fbf.ParentFolderGuid <> '00000000-0000-0000-0000-000000000000'
        ORDER BY fbf.depth desc
        FOR XML PATH('')
        ) AS [Path],
        c1.zItemName [Item],
        -- c1.zClassName [ItemClass], c1.zguid [ItemGuid],
        c1.zGroup [Permission Type], c1.zPerm [Permission]
    from @c1 c1
    group by c1.zRole, c1.zGroup, c1.zPerm, c1.zItemName, c1.zguid, c1.zParentGuid, c1.zClassName
    order by c1.zRole, [path], c1.zItemName, c1.zGroup, c1.zPerm

script_end:
    delete @c1


Viewing all articles
Browse latest Browse all 706

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>