public string GetItemSecurityString(string sPath)
        {
            System.Text.StringBuilder builder = new System.Text.StringBuilder();
            using (new Sitecore.SecurityModel.SecurityDisabler())
            {
                Sitecore.Data.Items.Item item = GetItemFromMasterdatabase(sPath);
                for (int i = 0; i < item.SecurityField.Assignments.Count; i++)
                {
                    Sitecore.SecurityModel.SecurityAssignment securityAssignment = item.SecurityField.Assignments[i];
                    builder.Append("Domain: " + securityAssignment.DomainName);
                    builder.Append(", group: " + securityAssignment.EntityID.ToString());
                    Sitecore.Data.Items.Item groupItem = GetItemFromSecuritydatabase(securityAssignment.EntityID.ToString());
                    if (groupItem != null)
                    {
                        builder.Append("(" + securityAssignment.DomainKey + " - " + groupItem.Name + " - " + groupItem.Paths.ContentPath + ")");
                    }

                    builder.Append("\n");
                    Sitecore.SecurityModel.ItemRights rights = securityAssignment.Rights;
                    builder.Append(" - " + rights.ToString());
                    builder.Append("\n");
                }
            }
            return(builder.ToString());
        }
        private AccessRights GetConverterAccessRights(Sitecore.SecurityModel.ItemRights rights)
        {
            AccessRights AccessRight = new AccessRights();

            if ((rights & ItemRights.AllowRead) == ItemRights.AllowRead)
            {
                AccessRight = AccessRight | AccessRights.Read;
            }

            if ((rights & ItemRights.AllowWrite) == ItemRights.AllowWrite)
            {
                AccessRight = AccessRight | AccessRights.Write;
            }

            if ((rights & ItemRights.AllowRename) == ItemRights.AllowRename)
            {
                AccessRight = AccessRight | AccessRights.Rename;
            }

            if ((rights & ItemRights.AllowCreate) == ItemRights.AllowCreate)
            {
                AccessRight = AccessRight | AccessRights.Create;
            }

            if ((rights & ItemRights.AllowDelete) == ItemRights.AllowDelete)
            {
                AccessRight = AccessRight | AccessRights.Delete;
            }

            if ((rights & ItemRights.AllowAdmin) == ItemRights.AllowAdmin)
            {
                AccessRight = AccessRight | AccessRights.Administer;
            }


            if ((rights & ItemRights.DenyRead) == ItemRights.DenyRead)
            {
                AccessRight = AccessRight | AccessRights.DenyRead;
            }

            if ((rights & ItemRights.DenyWrite) == ItemRights.DenyWrite)
            {
                AccessRight = AccessRight | AccessRights.DenyWrite;
            }

            if ((rights & ItemRights.DenyRename) == ItemRights.DenyRename)
            {
                AccessRight = AccessRight | AccessRights.DenyRename;
            }

            if ((rights & ItemRights.DenyCreate) == ItemRights.DenyCreate)
            {
                AccessRight = AccessRight | AccessRights.DenyCreate;
            }

            if ((rights & ItemRights.DenyDelete) == ItemRights.DenyDelete)
            {
                AccessRight = AccessRight | AccessRights.DenyDelete;
            }

            if ((rights & ItemRights.DenyAdmin) == ItemRights.DenyAdmin)
            {
                AccessRight = AccessRight | AccessRights.DenyAdminister;
            }


            if ((rights & ItemRights.AllowAll) == ItemRights.AllowAll)
            {
                AccessRight = AccessRight | AccessRights.AllowAll;
            }

            return(AccessRight);
        }