Sharepoint 2007: 'Only their own' permission on Document Library - Update!

OK, after getting tired of manually setting this using Sharepoint Manager 2007, I decided to put together a solution. This solution provides a nice drop-down on the Document Library ‘Security’ menu like this:

And when you click on the ‘Read/Write Security’ link, you’ll see this:

It looks and acts just like the page for standard lists - but this one also works for document libraries.

Download the solution from codeplex at http://moresharepoint.codeplex.com

Sharepoint 2007: Picture Library limitations

In working with the Picture Library in Sharepoint 2007, I’ve run across 2 limitations:

1. No web part connections. For some reason Microsoft decided that Picture Libraries would never need web part connections. It’s greyed out, as seen here:

2. Picture Libraries do not have the option to give users permissions to only view the pictures they created (and not view pictures that other users created). You can do this on non-document, non-picture library lists. Here is what it looks like on the ‘Advanced Settings’ page for a list:


But you don’t get that on a picture library.

Sharepoint 2007: 'Only their own' permission on Document Library

In Sharepoint 2007 you have a great permission you can set: ‘Only their own’. This allows someone to view and edit only the items that they have created, and not other items that other people have created. Administrators of the site can see everything, of course.

This is easy to set on a List under the list settings. However, if you are using a Document Library, the setting is nowhere to be found. It is there, but it’s hidden.

To change this setting, you can either write some code, as described here, or you can do the equivalent with Sharepoint Manager (make sure you get the 2007 version). Open Sharepoint Manager (while logged into your Sharepoint Server), drill down to the Document Library you are interested in, and you should see the ‘WriteSecurity’ setting. Change it to 2 to effectively set it to ‘only their own.’

However, keep in mind that this only changes what the user can do via the UI. If they get to the list data via web services or some other method, this won’t prevent them from getting at other people’s data.

Passing a table using Nav Automation

I just had someone comment on my previous blog post asking how to pass a table using Nav Automation. Great question.

You can pass complex objects using Nav Automation, but only ones that you define (or that have been explicitly written to work with COM). This means that you can’t pass a DataTable object, but you can create your own implementation of a DataTable object and pass it.

In your complex object, you have to explicitly define every property and method that you need to call on that complex object and surface those properties and methods through COM.

Read More

x does not contain a definition for y

I just ran across this problem… again… and because I didn’t note the solution last time I had to figure it out again. It’s so simple - but so hard to remember. Let’s hope that next time I hit this I’ll at least remember that I blogged about it. Here we go.

I’m building a web site, and it makes use of some DLLs that come from some C# libraries I’ve built. Over the course of time, I’ve added some functions to the libraries that I use in my website. And the website picks up the new functions and everything is great.

Then one day I come along and try to build the website in Visual Studio, but it gives me an error because it says that one of the newer functions in my library is missing. Here’s the error:

className does not contain a definition for functionName
Hmm. I check the other project (which lives in the same solution), and the function is there. So I go to my web control, which is generating the error, I right click on the function name, and click ‘Go to Definition’, and sure enough, it jumps right to the function.

After a couple of hours of removing pieces and parts from different projects and trying to narrow things down, all without any avail, a thought finally hits my brain. The GAC!

Sure enough, an older version of my library somehow ended up in the GAC. I removed it from the GAC, then everything built just fine.

FYI, to remove a library from the GAC, browse in windows explorer to c:\windows\assembly, right click on the dll you want to remove, and click ‘uninstall.’

Linq causes the Setup project to fail when building

All of a sudden, my setup project stopped building. It was very strange - when I tried to build it, it would say that the build failed, but it gave no errors. Nothing anywhere.

Thankfully, I’m not the first person to have run across this. It turns out that adding Linq to one of the projects in my solution caused this failure - it appears to be a bug in Visual Studio.

The solution appears at Microsoft’s Connect site (be sure to look in the ‘Workarounds’ tab) - https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=317870

Here is what Daren wrote:

1. Close VS 2008.
2. Open the project file containing the LINQ To SQL item in Notepad.
3. Remove the following lines:

1
2
3
<ItemGroup>
<Service Include=”{3259AA49-8AA1-44D3-9025-A0B520596A8C}” />
</ItemGroup>

The Setup Project will now build successfully. However, if you double-click the DBML file to open the designer in VS 2008 the Setup Project will stop building again. The above lines do not get re-added to the project file but the Setup Project will stop building anyway. Just restart VS 2008 and it will work again – until you open the DBML designer again. Once the Setup Project fails due to this problem it will never build successfully until after you restart VS 2008.