locked
Can i make a list like this in sharepoint 2007? RRS feed

  • Question

  • hi i want to create a list, but i think sharepoint server 2007 doesn't allow to do that way.

    I need to make a list with products, where one column will be a "permission to see" value being public, private or administration only. This column will define which groups can view that product, meaning that some group permissions see some products while others don't trough a list view.

    Is this possible to be done?

    Thanks
    D
    Saturday, July 28, 2007 8:57 PM

Answers

  • The solution is to do some .NET coding.  SharePoint allows EventReceivers that listen in on ItemAdded and  ItemUpdated (amongst many other events).  Whenever the Item is being created, your custom EventReceiver's OnItemAdding method will be called to run code to change your permissions based on the column information.  Unfortunately, since you have to wait until the item has been created, you cannot use the synchronous events to perform this action.  Meaning, there will be some latency between you assigning your dropdown value for permissions, and the system applying it.

    http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.aspx for more information on SPItemEventReceiver.

     

    Sunday, July 29, 2007 3:32 PM

All replies

  • To answer your original question about using a column to define permissions...no, it is not built-in through that mechanism and cannot be accomplished without some customization (designer or developer-based customization).

    To answer what I hope your real question, yes it can be done in WSS 3.0 / MOSS 2007.  SharePoint has that functionality intrinsically built-in through ListItem permissions.  Click on the menu for any given listitem and select Manage Permissions (Or something similar to that).  Modify your permissions for that specific item per your settings.

    Sunday, July 29, 2007 2:08 AM
  • That "real question" is not viable.

    What is the solution for cases like this? I see this as a quite common characteristic. Anyone faced similar problem?

    Sunday, July 29, 2007 10:33 AM
  • The solution is to do some .NET coding.  SharePoint allows EventReceivers that listen in on ItemAdded and  ItemUpdated (amongst many other events).  Whenever the Item is being created, your custom EventReceiver's OnItemAdding method will be called to run code to change your permissions based on the column information.  Unfortunately, since you have to wait until the item has been created, you cannot use the synchronous events to perform this action.  Meaning, there will be some latency between you assigning your dropdown value for permissions, and the system applying it.

    http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.aspx for more information on SPItemEventReceiver.

     

    Sunday, July 29, 2007 3:32 PM
  • I'm assuming that you want anyone who can get to the list to be able to add new items, regardless of what they are able to see (e.g, a person with access to "Public" items can still add a new item (and maybe be able to edit items that they can see.

     

    You could potentially do this with SPD, List Views and Audience targeted web parts. I haven't tried this, but conceptually it should work.

     

    You could do the following:

    • Create a subsite with the sole intention of hosting your list.
    • Create your list, adding the choice column for who should be able to view (e.g. all, public, private, and admin only.)
    • Create views that filter out the items you don't want to appear. (e.g. all items, public, private, admin.)
    • Use SPD to edit the default page.
      • So that your users can't get to the entire list by going to "View All Site Content", you can either
        • entirely remove the Quick Launch Pane
        • select the "PlaceholderLeftNavBar" and then select the little ">" indicator to show the "Common Content Tasks" and then choose Create Custom Content. You will then be able to remove the link to the "View All Site Content" while leaving the remainder of the Quick Launch intact.
      • Of course, if a user knows the link to the View All Site Content page, it will be possible to get around this. There may be other solutions, to prohibit a user from getting to the full list, such as removing or renaming the file http://[path]/_layouts/viewlsts.aspx (you would have to go to the server file system to do this.) (this could cause other issues, and is not recommended, but it would work)
      • The reason you used a unique subsite was so that you wouldn't disable the "view all site content" functionality for a site with other content you may want users to access via the Quick Launch panel.
    • Create audiences for the different groups. (All, Public, Private, Admin) and populate the groups with the appropriate individuals. For correct viewing, each person should only be a member of one audience.
    • On the main page for the subsite, add 4 web parts (you can do it one at a time using the default pop-up, or click on the Advanced Web Part Gallery link and drag the list 4 times to the page. You will then have
      • listname [1] through listname [4] on your page.
    • Edit each of the web parts
      • change the name to something unique.
      • Select the view, eg. the Private view for the "listname - Private" web part.
      • Under "Advanced" enter the appropriate audience.

    Now, when a site admin goes to the page, all four webparts with the different views will display. However, when other users go to the page, the web part that corresponds to their audience membership will be the only one displayed and will contain only the information that the user is allowed to see.

    Thursday, August 2, 2007 5:42 PM