Give SharePoint Site Columns (Fields) a different display and technical name via the webinterface

Leave a comment

Probably for some people this is obvious, but I just found out yesterday and I thought I should share it.

When you create a site column (or Field) as an installable feature you can specify a ‘DisplayName’ (the name that will be used to show the column via the webinterface) and a ‘Name’ which will be the technical name of the Field.

The webinterface does not seem to give you this possibility, somehow it seems you can only enter the displayname on the “Create new site column” page. However in reality it is both the ‘DisplayName’ and the technical name (or ‘Name’) that you specify on the moment of creation. Now here is a way how you can use the webinterface to create a sitecolumn that has different Display and Technical name:

Start by creating a new site column and give it the TECHNICAL column name. In this case I use “prefix_” as a prefix:

The fieldname that is both the display and technical name

Now to check the internal column name (you can hover over the display name and in the url that appears the technical name of the column is shown):

Url with the technical name of the column

No go back to the “Site columns” settings page and edit the site column that you have just created. Change the name into the DisplayName that you want the column to have:

The displayname of the column

Save the column and hover over the site column again. The internal technical name still has the prefix, and only the DisplayName of the column has changed!

The technical name still has the prefix

Advertisements

Claims Based Authentication, Item Based Permissions & Managed Metadata Solution

1 Comment

For my latest project I really started combining some of the specific SharePoint 2010 features. One of those cool new features is Claims Based Authentication. There are already a lot of articles about creating your own claims provider for SharePoint like:

http://msdn.microsoft.com/en-us/library/gg481769.aspx

and

http://blogs.technet.com/b/speschka/archive/2010/03/13/writing-a-custom-claims-provider-for-sharepoint-2010-part-1.aspx

What I used for my project is ‘Claims Augmentation’ which means that for my authentication provider I still use AD accounts. These accounts however are enriched with user-specific claim information on the moment they log in on the SharePoint website. After that it is possible to base your security on the augmented claims.

Claims Augmentation

Claims Augmentation

In my project ‘Case management’ plays an important role. I have created a Document Library and in that document library Document Sets are created of which each represents a different case. The most important aspect of these cases is that they are all of a certain type. Some users should have only access to cases of type 1, some users should only have access to cases of type 2 and some users should have access to both type 1 and 2. You get the picture ; ).

View of the Document Library

View of the Document Library

My solution is to use Item based security combined with claims based authentication. In my solution the claims are based on all possible case types. So for every case-type, there is a corresponding claim. On the moment of Document Set creation I break the role inheritance of the item (which is the Document Set), delete all other role assignments and add the role assignment of the claim that corresponds with the case-type. After that only users who possess the same Case-type claim have access to the Document Set and the underlying documents.

Item based permissions for documentset 1001 (Dutch language pack...)

Item based permissions for documentset 1001 (Dutch language pack...)

Remains the problem where I keep my list with all possible case-types (which is of course the same list that produces the claims). I decided to use Taxonomy feature of the Managed Metadata service for that. So now both the Case-type taxonomy metadatacolumn of my Document Set and the custom claims provider gets their list of claims/case-types from the Managed Metadata Service.

Taxonomy termset for casetypes and claims

Taxonomy termset for casetypes and claims

The custom claims provide uses a sql server table to determine which user has which claims. This table is queried each time a user logs in on the SharePoint website. It has a very simple structure with only 2 columns: username and claim.

The complete solution looks like this:

Solution overview

Solution overview