Re: problem with lists with customized permissions and broken inherance
- From: Mike Walsh <englantilainen@xxxxxxxxxxx>
- Date: Mon, 23 Jul 2007 13:32:07 +0300
It looks very much like a code problem - certainly you quote a lot of code.
But the main problem with posting here is that you have installed MOSS 2007.
This .windowsservices newsgroup is only for people who have installed the WSS 2.0 product or who have installed the WSS 3.0 product.
The equivalent (old) newsgroup for people who have installed SPS 2003 or MOSS 2007 is microsoft.public.sharepoint.portalserver
But I, given the code you are quoting, would post it to the Programming newsgroup for all SharePoint products which is
microsoft.public.sharepoint.development_and_programming
(the admin group that is parallel to that one - i.e. is also for all products - is .setup_and_administration)
Mike Walsh
WSS FAQ http://www.wssfaq.com
no questions by e-mail please
vicente.montequin@xxxxxxxxx wrote:
Hello every body. I'm having an odd problem with a couple of lists.
with the permissons inherance broken and with customized permissions.
The lists are populated with about 2000 elements each one. I'm loading
the items from a external file, so I'm using a code program for
inserting items and customizing permissions (you can see a fragment of
the code below). After inserting, all seems to be rigth: all items are
inserted and the permission masks are working properly, so only
granted users can see the right items.
But the problem is when I'm trying to put together both lists in the
same page. Then, odd things start happening. If I access with
administrator role, all items are presented, but if I access as a
normal user, one of the lists don't show all the items, just only a
few. Surpressly, if I copy the .aspx page, sometimes it works fine. I
have tried with views inserted directly from the wss, other inserted
with Designer, other converted to XSLT, ... Allways the same problem:
not all items that a user is granted to see are presented. And the
more surprissed is that this only happen when I try to put together
both lists. If I work only with one list, or with one of these lists
and other lists of the site, it doesn't happen. I have been four days
changing things and doing tests, and I can't find any reason for this.
Additionally, it always happen with a similiar number of items, but
not the same number, but it doesn't look like a space problem because
the items in fact are inserted right, and there is no problem except
when I try to show both lists together. Additionally, doesn't exists
any connection between both lists, except that both are inserted by
code program, both of then have customized permissions and one of then
is being used by the other through a look up field.
I would aprecciate your comments about what could be happening. I'm
using the evaluation version of MOSS, but I think it's not specific
problem of MOSS.
Best regards.
P.S.: I think this is not only a code problem, I think it could be a
general problem and that is the reason why I'm posting in this group.
SPGroupCollection grupos = webSite.Groups;
String aux = itemOrdenes["Gestor"].ToString();
String grupogestor =
aux.Substring(aux.LastIndexOf(";#") + 2);
SPGroup grupoOrdenes =
buscarIDGrupo(grupogestor);
SPGroup grupo =
buscarIDGrupo(itemData["EKGRP"].ToString());
//Console.WriteLine("Grupo: " + grupo.Name + "
- Identificador: " + grupo.ID);
SPRoleAssignment RoleAssignment = new
SPRoleAssignment(grupo);
SPRoleAssignment RoleAssignmentOrdenes = new
SPRoleAssignment(grupoOrdenes);
SPRoleAssignment RoleAssignmentDirectorIng =
new SPRoleAssignment(grupos.GetByID(16));
SPRoleDefinition RoleDefinition =
webSite.RoleDefinitions.GetByType(SPRoleType.Reader);
RoleAssignment.RoleDefinitionBindings.Add(RoleDefinition);
RoleAssignmentOrdenes.RoleDefinitionBindings.Add(RoleDefinition);
RoleAssignmentDirectorIng.RoleDefinitionBindings.Add(RoleDefinition);
//Console.WriteLine("IdentificadorPermisos: "
+ identificadorPermisos.ToString());
if (!
identificadorPermisos.HasUniqueRoleAssignments)
{
identificadorPermisos.BreakRoleInheritance(false); //pass true to copy
role assignments from parent, false to start from scratch
}
if (modificando) //si estamos modificando,
borro los permisos del gestor anterior
{
//for (int i = 0; i <
identificadorPermisos.RoleAssignments.Count; i++)
//{
// //Console.WriteLine("Identificador
del permiso: " +
listItems.GetItemById(identificadorPermisos).RoleAssignments[i].Member.ID);
// //Console.WriteLine("Identificador
del permiso " + buscarIDGrupo(anteriorgestor).Name + " que quiero
borrar :" + buscarIDGrupo(anteriorgestor).ID);
// if
(identificadorPermisos.RoleAssignments[i].Member.ID ==
buscarIDGrupo(anteriorgestor).ID)
// {
// //Console.WriteLine("Borrando
pertenencia al grupo: " + anteriorgestor);
//
identificadorPermisos.RoleAssignments.Remove(identificadorPermisos.RoleAssignments[i].Member);
// break;
// }
//}
int contadoraux =
identificadorPermisos.RoleAssignments.Count;
int aux2 = 0;
for (int i = 0; i < contadoraux; i++)
{
//Console.WriteLine("La i: " + i);
//Console.WriteLine("Permiso [" + i +
"]: " + identificadorPermisos.RoleAssignments[aux2].Member.Name + "
con identificador: " +
identificadorPermisos.RoleAssignments[aux2].Member.ID);
if
(identificadorPermisos.RoleAssignments[aux2].Member.ID != 16)//si es
distinto de director de ingenieria
identificadorPermisos.RoleAssignments.Remove(identificadorPermisos.RoleAssignments[aux2].Member);
else
aux2++; //la posición cero del
vector pasará a ocuparla el director de ingenieria, borramos a partir
de el.
}
}
identificadorPermisos.RoleAssignments.Add(RoleAssignment);
identificadorPermisos.RoleAssignments.Add(RoleAssignmentOrdenes);
identificadorPermisos.RoleAssignments.Add(RoleAssignmentDirectorIng);
//añadir permiso tambien a la orden
correspondiente
añadirPermisosOrden(identificadorOrden,
RoleAssignment);
identificadorPermisos.Update();
- References:
- problem with lists with customized permissions and broken inherance
- From: vicente . montequin
- problem with lists with customized permissions and broken inherance
- Prev by Date: Setting up a project glossary in SharePoint
- Next by Date: WorkFlow modification Issue
- Previous by thread: problem with lists with customized permissions and broken inherance
- Next by thread: Setting up a project glossary in SharePoint
- Index(es):
Relevant Pages
|