Wednesday, October 24, 2012

How to suppress SharePoint 2010 ribbon based on permissions


Have you ever noticed how in SharePoint 2010 Owners see the ribbon and can click Site Actions/Browse/Page, and Readers see the ribbon too but there is no any actions or tabs to click and they see dark blue band. In some cases there is nothing else going on up there for Readers. It is wasted real estate!
Owner:
 
Reader:
 
The Reader can use all the extra space for some website goodness!
This is easy to solve.
- Open the master page, find the div tag: <div id="s4-ribbonrow"- Put the following around it: 
<Sharepoint:SPSecurityTrimmedControl runat="server" Permissions="ManageWeb"><div id="s4-ribbonrow" …</div></SharePoint:SPSecurityTrimmedControl>

From here

Monday, October 15, 2012

Restarting IIS after installing/removing/upgrading SharePoint solution

Do I need to restart IIS after installing/removing/upgrading solution?

The answer is simple - YES.

Found few articles explaining it:

SharePoint Solution Deploy, retract, upgrade – What causes your SharePoint farm to go offline IISRESET (web server outage)


Deploying a solution

Initially, the package manifest.xml is checked for its content & destination locations. The files specified in the manifest.xml are copied to the locations. After solution files are copied to the target servers, a configuration reset is scheduled for all front-end Web servers; the reset then deploys the files and restarts Microsoft Internet Information Services (IIS). Farm administrators can specify when this occurs (a timer job).
Reference: http://msdn.microsoft.com/en-us/library/aa544500.aspx


Retracting a solution

On each front-end Web server, the following occurs:
- Internet Information Services (IIS) is disabled.
- Files are removed from the system.
- IIS is re-enabled and Microsoft SharePoint Foundation is reloaded when a user browses to a page.

- Farm administrators can specify the time when the retraction takes place.


Upgrading a solution

There are two ways to do an upgrade of a solution. i.e. Replacement and Update. Both inolve a an IISRESET.
Replacements are essentially a retract and optionally removal of a WSP. Then the new version is added and deployed. Causing an IISRESET (twice!).
Updates are essentially a deployment with the same file name but different GUID. SharePoint detects this and retracts the old solution and deploys the new one..causing an IISRESET.
Please note that there is a -local option when deploying a solution, but according to MSDN, this is to be used for troubleshooting purposes.
Reference: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spsolution.deploylocal.aspx


Why do we need to restart IIS after copied DLLs into Assembly
We restart the IIS to reset Application pool as lot of things in SharePoint are cached. The alternative option is you can recycle the application pool of the application for which you have deployed the WSP or DLLs

Deploying solutions with no downtime

Found interesting article about deploying solutions with no downtime


The most important attribute we need to remember is the –Local attribute this will only ensure that the solution deployment will only occur on the local server.
Other attributes include:-
  • WebApplication – this will deploy the solution to a specific Sharepoint Web Application
  • GacDeployment – this option allows a solution which contains .NET assemblies to be installed in to the GAC to be installed.
  • CasPolicies – this option allows a solution which contains code access security policies for the assemblies / web parts to be deployed.