none
如何在 c# 程式 讀出 某ListItem 的 所有 Roles 的 Permissions? RRS feed

  • 問題

  • 我用如下的 C# Code,  感覺 只有 讀出 所有 Roles 的  BasePemissions for Web ( 也就是按 Item 的權限管理 進去 設定的部份, 無法讀到)

     

                                        SPListItem item;

                                 '    item Aiigned

                                 ..

                                 ..

                                        foreach ( SPRoleAssignment ra in item.RoleAssignments )
                                        {
                                            Console.WriteLine( "------------");
                                            Console.WriteLine( "Item RoleAssignment: " + ra.Member );
                                            //  Console.WriteLine( "Item RoleAssignment: " + ra. );
                                            foreach ( SPRoleDefinition roledef in ra.RoleDefinitionBindings )
                                            {
                                                //Console.WriteLine( "SPRoleDefinition : " + roledef);
                                                Console.WriteLine( "SPRoleDefinition : " + roledef.Xml );
                                                Console.WriteLine( "SPRoleDefinition : " + roledef.Description );
                                            }
                                        }
    2009年1月19日 上午 02:10

解答

所有回覆