Showing posts with label sharepoint2013 developement. Show all posts
Showing posts with label sharepoint2013 developement. Show all posts

Monday, November 4, 2013

Hide Ribbon from Anonymous users in SharePoint 2013

In my current project, I had a requirement to hide the ribbon from anonymous users dude to security reasons. In SharePoint 2010 we can do that by modifying the master page. But in 2013, we can’t modify the master page directly. We need to modify the .html file associated with the master page.

We have .html file for every master page with same name, for Seattle.master we have seattle.html and oslo.master we have oslo.html pages which specify the controls and tags of the master page.

We can see the tags in HTML pages start with <!--MS:--> and <!--ME:--> that shows the markup inside of the tags for the corresponding masterpage. We need to do changes in the html page to hide the ribbon from anonymous users.

Open html page in SharePoint designer 2013, (Master Pages-> Select appropriate html file, Edit the file)

Search for “<div class =”ms-belltown-anonshow”>” tag and add following code on the top of the div,
<!—MS:<SharePoint:SpSecurityTrimmedControl runat=”server” permission=”AddandCustomizepages”>—>

Add following code after closing div tag.

Save HTML file. After adding these tags, design manager will update the respective masterpage for hiding the ribbon from Anonymous users. Instead of “AddandCustomizepages” permissions, we can give list of enumeration permissions referred in the link

Monday, May 13, 2013

SharePoint 2013 Excel Services: We don’t know what happened. But something went wrong

While working with SharePoint 2013, checking the audit log reports in excel got the error as shown below. I have already configured the excel service as shown in the msdn

Checked the event logs, shows the error below.
Unable to access the workbook cache “C:\Windows\TEMP\Excel Server\FileCache\d8746073-d542-5f43-9b0d-45d345fd9f43\Workbooks. Excel Services Application unable to function without a workbook cache.

 After some troubleshoot found that the root problem is that to create or access the workbook. This is a permission issue. As a managed account, the Excel Services application pool is a member of WSS_WPG security group, to execute the permissions on the Temp folder.

To fix the issue I have followed the steps below,

Start -> run -> enter “%WINDIR%\Temp folder.

Click on properties, select security tab, click on Edit button

Add Modify permissions to WSS_WPG group and do IISRESET.

Now everything will work as expected.

Here we can grant permissions to each and every application pool. Here I just granted the permissions to the WSS_WPG group in other managed accounts need to create temporary cache files.

Wednesday, March 20, 2013

Sharepoint 2013 - App Model

App Model is the major and interesting change from SharePoint 2010 to share point 2013. It brings a new set of opportunities from development environment. Before going to app model, we can check few things,

What are development models we have in share point?

  • We have Solution Package model and Client object model and Ecma Script Object model. Solution Packages models are farm solutions and Sand Boxed solutions  Extended in SharePoint 2010) are not deprecated or not going away. There is no change in both of them.
  • App model will not support SharePoint Server side code. there is no chance of access like Sand boxed solutions. All the code must be run in client side (JavaScript) or out of share point (like Azure or other hosting Plat forms), just connect back to share point remotely.
  • Only SharePoint 2013 will support App Model  There is no support for earlier versions of share point yet.
Why App Model?

In SharePoint 2010, with farm solutions, custom code was deployed into server. All the things will deployed to the server means an IT consultant with console access would need to upload the solution package to the server. So that the Access must be required to deploy the solution in farm level. This will only works On Prem environment. It will not suitable for hosted deployment. Both Farm and Sand Boxed solutions developer need to have full understanding on the server and command on sever API.Farm solutions are not suitable for cloud environment. We can use sand boxed solution on cloud environment, but there is lot of limitations put users off from it. For example we cannot call External Web services from sand boxed solutions and we can only access limited set of SharePoint API's.

App model is mainly designed for cloud hosting. It will not use server side code. It will use only client script like java script or jQuery, and will work on top of share point framework. So that it will keep environment light. you can easily migrate the apps and easily add the apps from app store.

App Isolation- 

Apps are isolated. One app cannot talk with other app. When we install app share point will create a sub site in the existing site like as : here apps will run under a separate domain. APPID will generated for share point.

There is no alternative way to call the app with out URL  If you want to try to call the app from parent site (i mean site which app was created or app was installed) it access to URL only. The reason here isolation. Apps will run under a separate domain, If in case apps will run same domain, here apps will use java script to access data. That will cause security issue. So that Microsoft people elected to go for another domain and that will unique for app. So that we can skip cross site attack.

We can present the app in three ways to the customers-

  • Immersive App: Here app will take an entire page and when we click on the app it will redirect to a page. Every App has this functionality because every app app has a start page.
  • Part App: This is app is located in a part of a page, similar as web part  Suppose we have map just provide a widget to show the location.
  • Custom Action App: Here app will be shown in a ribbon control or as menu item. For example we can take print option.
Scope of an App-

There are two choices to build the app scope

  • Web Scoped: Web scoped apps will live only with in the app web.
  • Tenant scoped: we can publish the app to the entire company or to the public scope.
Availability of Apps -

Just like Mobile apps we have a market for share point apps and we can acquire or buy the apps from app market. There is a private market place for employee in corporate company. Microsoft is having market place in cloud. Developers can develop their apps and sell it through Microsoft app market. There is more chances to launch third party market places and sell the apps. This will get more spice to the app market and help boosting the competition.

Types of Apps-

There are three types of app development models are available to build apps.

  • SharePoint Hosted Apps: Here in this option every thing in SharePoint "With in SharePoint Only". When you install the app, a new site will create with in the share point and will keep all the app content in share point  app content will be lists, Pages, Site Columns  Content Types etc. All the process will happen in client browser using client side scripting.
  • Developer Hosted Apps/ External Apps: In this scenario all the logic will be external to share point  Logic may be in any technology like .net , Java, PHP...and on any infrastructure like IIS, Apache ... Here share point will work as a Launching pad. That might do anything. Here the name "Developer/External" comes that developer or external is the responsible for the code.
  • Azure Or Auto Hosted: Here App will be located in cloud. When ever developer download the app from cloud and installs it in site, app will automatically create site and also provisions a new azure website. We can build this type of app and host in cloud. 
What i need to do to develop Apps?

Before developing and deploying apps, we need to do some configurations,

  • Subscription service and App Management service must be running for apps usage.
  • we need to create the DNS domain to create the unique URL's for app.

What we can do with apps?

  1. We can write remote event receivers
  2. Deploy new fields based on existing field types
  3. Can provision lists, Content types  with in app website.
  4. We can have custom application pages to work
  5. Can consume custom web services.

What we can't do?

  1. Custom Site Definitions
  2. Delegate Controls
  3. Custom Themes
  4. Custom Action groups and Custom Hidings
  5. Custom User Controls
  6. Timer Jobs
  7. Workflows

Thanks for Salman Blog and Andrew Connel to providing very useful posts on App model. 

Monday, March 11, 2013

SharePoint 2013- you receive "Side Loading of apps is not enabled on this site error while installing app"

If got an error "Side Loading of apps is not enabled on this site error while installing app" , while deploying an app to share point 2013 site by using VS 2013. The main reason that in share point 2013 site we have a new site template, "Developer site", We can only deploy the apps to developer site.

Finally the solution is you can just deploy the apps to developer site ( site / site collection created with developer site template.)