Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In SharePoint 2007 item level permissions are supported.</p> <p>You could create a list event handler (SPItemEventReceiver). Every time an user item is changed/added the handler could update the corresponding project item.</p> <pre><code>public class EventHanlder: SPItemEventReceiver { public override void ItemAdded(SPItemEventProperties properties) { // collection user and project information from the item being updated. SPListItem item = properties.ListItem; SPUser user = new SPFieldUserValue(item.Web, item["UserFieldName"] as string).User; int projectId = new SPFieldLookupValue(item["ProjectFieldName"]).Id; // create role assignment for the user on the user item. SPRoleAssignment ra = new SPRoleAssignment(user); SPRoleDefinition rd = item.Web.RoleDefinitions.GetByType(SPRoleType.Reader); ra.RoleDefinitionBindings.Add(rd); ra.Update(); // get the project item and update the role assignments. SPList projectList = // retrieve project list here... SPListItem projectItem = projectList.GetItemById(projectId); projectItem.RoleAssignments.Add(ra); } } </code></pre> <p>This is just sample code. I'm not 100% sure if the thing with the SPField***Value works like that.</p> <blockquote> <p>Now I want to give each user permission to see the project he's assigned to so that when he opens a third form, a combobox filled with projects will only show the projects he has permissions on.</p> </blockquote> <p>This should be done automatically with a lookup field, since only items a user has permissions on will be displayed.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload