Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

    Advertisements
  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Archive for October, 2015

Sign Certificate

Posted by Paul on October 31, 2015

This is a part of the article-series:

http://www.jeanpaulva.com/index.php/2015/04/25/app-development-pre-requisites/

Sign Certificate

We need to Sign the Certificate for using in the PHA applications.

Locate the Exported Certificate.  We need the path in further steps.

Open PowerShell ISE in Administrator mode.

Run the following script.

Add-PSSnapin “Microsoft.SharePoint.PowerShell”

$issuerID = “88ccebfd-713b-21d3-f1a7-a4133a1b8a8a”
$certPath = “C:/Cert/SharePoint2013Cert.cer”
$cert = Get-PfxCertificate $certPath
$web = Get-SPWeb “http://sharepoint”
$realm = Get-SPAuthenticationRealm -ServiceContext $web.Site
$appid = $issuerID + ‘@’ + $realm
New-SPTrustedSecurityTokenIssuer -Name “PHA App” -Certificate $cert -RegisteredIssuerName $appid –IsTrustBroker

Once executed your Certificate is Signed.

image

Now you can use the Signed Certificate for the PHA application.

Advertisements

Posted in SharePoint, SharePoint 2013 | Leave a Comment »

BCS Error – AuthenticationMode RevertToSelf

Posted by Paul on October 18, 2015

In this post we can examine a common error while configuring BCS for SharePoint 2013.

Error

You will get the following error while first time configuring BCS.

image

Solution

Following would be the solution.

You need to update the property RevertToSelfAllowed at Service Application level.

image

You can use PowerShell to update this.

image

Run the following code.

$bcs = Get-SPServiceApplication -Name “Business Data Connectivity Service”

$bcs.RevertToSelfAllowed = $true;

$bcs.Update();

Now retry opening your BCS List. The error should disappear.

Summary

In this post we have explored a common error while configuring BCS & steps to resolve it.

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »

REST API to check User Permission

Posted by Paul on October 17, 2015

In this article we can explore the REST API to check User Permission for a Group.

Scenario

You are working in a client-side script SharePoint App. You need to check whether the current user belongs to the Approvers group. The twist is that the current user is added to an AD Group and in turn the AD Group was added to SharePoint group.

Solution: Following is the REST code to get the result.

http://sharepoint/_api/web/sitegroups/getbyname(‘Approvers’)/CanCurrentUserViewMembership

Following is the result.

image

image

You can try REST code in browser address bar itself. Later you can wrap a JavaScript or AngularJS around it to attain programmatic checking.

If I enter an invalid group name, the result will be different.

http://sharepoint/_api/web/sitegroups/getbyname(‘InvalidGroup’)/CanCurrentUserViewMembership

image

We can also check Site Collection & Sub Site permission groups using the same way.

Pre-Conditions

The above code is checking does the user have View Membership permission. In order to make this work we need to configure the following group property as true.

By default this property will be true.

image
You can find more property information using References link.

image

References

https://msdn.microsoft.com/en-us/library/office/jj245943.aspx

Summary

In this article we have explored the REST API to check User Permission for a Group.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , , | Leave a Comment »

SharePoint 2013 Publishing Feature

Posted by Paul on October 15, 2015

In this article we can explore about the Publishing feature of SharePoint 2013.

Publishing Feature

SharePoint Publishing feature enables the following to enable better Content Management:

· Content Approval where an author will create content, approver will approve it & viewers will consume it.

· Page Layouts where custom page layouts with WYSIWYG capability will be provided for creating content.

Once the feature is enabled, following will be created automatically:

1. Publishing site template

2. Permission Groups

3. Pages library

Enable Feature

SharePoint Server Publishing Infrastructure feature need to be enabled in the Site Collection features.

image

Once enabled, you can create new site using the Publishing template.

New Site

Once the Publishing feature is enabled, you will get the Publishing template.

image

The publishing site instance is shown below.
image

You can see that the Pages library too created.

image

Following new permission groups got added.

image

image

Publishing sites are not replacement for Team sites. Both provides its own features & functionalities.

References

https://msdn.microsoft.com/EN-US/library/office/microsoft.sharepoint.publishing.aspx

Summary

In this article we have explored about the Publishing feature of SharePoint 2013. In the upcoming article we can explore more on the functionalities of publishing site.

Posted in SharePoint, SharePoint 2013 | Tagged: , | Leave a Comment »