Friday, November 21, 2014

SharePoint Hosted App: How to manage DateTimeControl Picker and Format with the correct Language and Culture

This article explains how convert the Raw Date from REST calls and manage Date Format base in different Languages and lcid and how to manipulate the Out of the Box SharePoint Control  DateTimeControl to display the correct Language in the DatePicker with the correct Date Format.  
This is very important when you are creating your App with multiple Languagues and you need to keep integrity of Regional settings bettwen your Hosted site and App Web Site and have to be done in dinamyc approach.

DateFormat SharePoint Hosted App example 

Let's go for steps:
  • Create a Site and define his Language
    • For this example a Site Collection was created base in Language "PT-pt" and Lcid 2070

Create a SharePoint Hosted App call "DateFormat", this solution shows the tips and trick about managing Dateformats, Culture and Languages using out of the box SharePoint controls and Raw dates from SharePoint Data.

Add DateTimeControl in App

Include the SharePoint Web control Markup DateTimeControl in the default.aspx Page.

When the SharePoint Hosted App is installed in the SharePoint Site access the App Web select the calendar Picker,
Since you create your Host site base in Language "PT-pt" and Lcid "2070" you are expecting to get the correct Language, but that don't happen like is shown in the image bellow.

PS:"The control has a LocaleId parameter but i dont include in the Control since the language can change and don't have access to server side code, everything should be made using JS"

If you access to F12 Developer tools you are able to see that the DatePicker control opens a iframe base in Parameters but the most interresting are the values from there, 
  • lcid: 1033
  • Langid:2070 

This is the reason the calendar appear with En-US Language in the calendar and not with PT-pt language, 

To get the correct values from the iframe parameter you can use the Regional Settings of the current Web.

For more information about the parameter see the 3 point "Calendar Options" in the following article, 
Using SharePoint’s DatePicker Control:

You can use REST call fill the needed parameters in the datepicker Iframe request.

Thef following code example call the Regional Settings and replace the parameters that i used in the Calendar picker with the lcid "1033" to correct lcid, for this case "2070":

      url: getQueryStringParameter("SPAppWebUrl") + "/_api/Web/RegionalSettings",
      method: "GET",
      headers: { "Accept""application/json; odata=verbose" },
      success: function (data) {
          $(".ms-dtinput a").each(function () {
              $(this).attr("onclick", $(this).attr("onclick")
                  .replace(/cal=\d{1,2}/"cal=" + data.d.CalendarType)
                  .replace(/lcid=\d{4}/"lcid=" + data.d.LocaleId)
                  .replace(/ww=\d{7}/"ww=" + ("0000000" + data.d.WorkDays.toString(2)).slice(-7))
                  .replace(/fdow=\d{1}/"fdow=" + data.d.FirstDayOfWeek)
                  .replace(/fwoy=\d{1}/"fwoy=" + data.d.FirstWeekOfYear)
                  .replace(/hj=\d+/"hj=" + data.d.AdjustHijriDays)
                  .replace(/swn=\w+/"swn=" + data.d.ShowWeeks));

After the change is made, access the datepicker and language appears correctly with the Date Format included as shown in image below.

If we access the html associated in the datepicker control, we are able to see the Lcid is different with the correct Regional Setting lcid "2070".

Convert REST/Raw Date to correct Format

After we correct the SharePoint Control DateTimeControl we should start to convert Date to string with the correct Language Format, for this the following example make the convertion of Date to String with the Language associated in the Site.

The following exame make a call to Object Web/Created to return the Date when the Site was created and include in a Text Box with the Date format associated with the Culture.

        url: getQueryStringParameter("SPAppWebUrl") + "/_api/Web/created",
        method: "GET",
        headers: { "Accept""application/json; odata=verbose" },
        success: function (data) {
            $('#OutputDate').val(new Date(data.d.Created).format(Sys.CultureInfo.CurrentCulture.dateTimeFormat.ShortDatePattern));

for this example the raw output date will be "2014-11-21T09:57:17" and the method "Date(data.d.Created).format(Sys.CultureInfo.CurrentCulture.dateTimeFormat.ShortDatePattern)" converts the Date to the Culture Date Format that is associated in the Server but by default is "1033" as shown bellow image.

To make the correct Date format convertion you need to include the following reference in your App Page, JS reference to SP.DateTimeUtil.js.

This SharePoint Object make the convertion to the correct Lcid for this case "PT-pt"

<SharePoint:ScriptLink Name="SP.DateTimeUtil.js" runat="server" LoadAfterUI="true"   />

Deploy the new version of the App and validate the Date format from the REST call and will be with the correct Date Format in this case for "PT-pt" and "2070".

After this change is made you can make the call to date and make the JS convertion from String to Date using the method "parseLocale"

var date = Date.parseLocale($('#OutputDate').val());

and returns the value as a date without having error of bad Format of Date 

With the correct Date Object you are able to make the necessary changes in your SharePoint Hosted App without incorrect formats and issues in SharePoint controls.
A big thank you to my colleague "Selim Gezgin".

Support Articles:
Using SharePoint’s DatePicker Control:

Hope you like this article,
Kind regards,
André Lage

Thursday, October 09, 2014

How many Ribbons options can you hide in a minute? How much productive can you be!

I see a lot of article talking the SharePoint ribbon manipulation using Css and Javascript, but do you really want to use JS and CSS for this type of task?
After review a lot of this articles about CSS and JS i ask my self,  how much time/effort is enough to manage this type of customizations almost all of them take minimal 1 hour "find the Ribbon location, create CSS and JS, upload file do Library, edit web part and include reference to files, do the same task for "Add, edit, View Form", do the same for other Libraries,,,,"

After review the time here are a list of problems founded with this approach:
  • Multiple WebPart with injected javascript could turn pages slow. 
  • Custom JS code could break the MDS and afect the load page performance
  • Harder to hide/show Ribbons associated to permissions, requires code.
  • This approach could not follow company policies and could require changes in CSS
  • A lot of this Custom code don't have documentation to explain what was done and where was implemeted "Pages" turnning very hard to other developers/consultant understand changes or migrations
SharePoint already has Objects to make this type of management in a way you can be compliant with your client, follow the company policies and avoid issues described before and Migrations
The problem here there isn't user interfaces to manage this objects and Ribbons options and here the Processlynx Custom Action and Ribbon Manager could help.

If you are a developer and you want to do it by yourself here are nice documentation you about UX in SharePoint 2013 that could help you understand the effort associated and the Processlynx Ribbon Manager app is trying to avoid that.
SharePoint 2013 and SharePoint Online solution packs

If you are a developer here a article that explains the XML structure with the complexity of Ribbons.
Examples of Ribbons Customization in SharePoint 2013

The Processlynx Ribbon Manager app compiles all this options needed to support the Management of Ribbons and Customs Actions like"Ribbons Locations, Image Locations, Content types associate, lists and others options" to became more efficient and fast customizations in SharePoint Sites.

Processlynx Ribbon Manager App 
Processlynx Custom Action and Ribbon Manager
You can make a test using the free Office Store version limited to App Web
Processlynx Custom Action And Ribbon Manager Demo

This video shows how easy the app hide Ribbons using a user friendly App interface and SharePoint UserCustomAction Object in background, for this case used the "PLX Custom Action and Ribbon Manager", this example hideRibbons options from the rich text edit option from Wiki Pages.

This video show another example on how you can select a specific list and Wiki pages and hide some Ribbons locations.

Hidden Locations from Library 

  • Ribbon.Library.Actions.Sync
  • Ribbon.Library.Actions.MyLinks
Hidden Locations from Wiki Page

  • Ribbon.WikiPageTab.PubPageActions.Preview
  • Ribbon.WikiPageTab.Share.ViewAnalyticsReport
  • Ribbon.WikiPageTab.PubPageActions.SetHomePage

Support Links:
Processlynx Custom Action and Ribbon Manager
New features released for app Processlynx Custom Action and Ribbon Manager
Processlynx Custom Action And Ribbon Manager Demo
Examples of Ribbons Customization in SharePoint 2013

Hope you like this Article
Kind regards, 
André Lage

Thursday, October 02, 2014

Export/Import SharePoint objects using JSON and REST in App

One big request from IT Managers and Office 365 SharePoint Site is about Migrations of data and SharePoint Objects from SharePoint Site, yes there is a lot of tools that help you making this type of migration,we hear a lot about moving users, Lists, Content types but how this really works...
We can have multiple ways since SharePoint Object Model Server Side, Client Side Object Model or REST operations as examples.
This example show how you can use the data in JSON base from REST operations and SharePoint Objects from SharePoint Sites then change it and import to different SharePoint sites .

The created SharePoint App model shows how we can export and import SharePoint Objects using JSON and REST with Javascript.

This type of method can be very useful to move SharePoint Site Configurations to multiple sites, for this example used the "RoleDefinition" object to export a existing RoleDefinition Object and import with a different name using JSON data.

Support documents:
"Users, groups, and roles REST API reference"
"How to Convert REST Call to SharePoint JSOM Object (ECMAScript)"

How the App Works?

The app get a existing RoleDefinition permission Name in the SharePoint site and make a REST operation to return the JSON data associated.
The first thing was get the Name of a permission in Permission Levels, you can access the page following the Top Right Menu "Site settings > Site Permissions > Ribbon "Permissions Levels"".

Export JSON Roledefinition

When the Permission name is selected access to ExportImport App and select the Option "Export RoleDefinition JSON" and the JSON data is displayed in the TextArea.

function ExportJson() {
    var executor = new SP.RequestExecutor(SPAppWebUrl);
        url: SPAppWebUrl + "/_api/SP.AppContextSite(@target)/Web/Roledefinitions?$filter=Name eq '" + $('#Roledefinition').val() + "'&@target='" + SPHostUrl + "'",
        method: "GET",
        headers: { "Accept""application/json; odata=verbose" },
        success: function (data) { $('#ExportJSON ').val(data.body); SP.UI.Notify.addNotification('Roledefinitions exported with Success!!'false); },
        error: function (sender, args) {
            SP.UI.Notify.addNotification('Request failed. ' + sender.statusText + '\n' + sender.statusCode);

Import JSON Roledefinition

Copy the JSON data and paste in the Import JSON TextArea and provide a new Name for the RoleDefinition and select "Import new Roledefinition JSON".
This operation will send a POST Method by REST with the JSON data and properties associated in the Body of the message to SharePoint.
After this the object should be created with success.


function ImportJson() {
    var item = JSON.parse($('#ImportJSON').val()).d;
    var executor = new SP.RequestExecutor(SPAppWebUrl);
    if (item.results.length == 1) {
            url: SPAppWebUrl + "/_api/SP.AppContextSite(@target)/web/roleDefinitions?@target='" + SPHostUrl + "'",
            method: "POST",
            body: "{ '__metadata': { 'type': 'SP.RoleDefinition' }, 'BasePermissions':{ '__metadata': { 'type': 'SP.BasePermissions' }, 'High': '" + item.results[0].BasePermissions.High + "','Low':'" + item.results[0].BasePermissions.Low + "'}, 'Description': '" + item.results[0].Description + "', 'Name': '" + $('#NameRoledefinition').val() + "', 'Order': " + item.results[0].Order + " }'",
            headers: {
                "content-type""application/json; odata=verbose"
            success: function (data) { SP.UI.Notify.addNotification('New role "' + $('#NameRoledefinition').val() + '" Roledefinitions imported with Success!!'); },
            error: function (sender, args) {
                SP.UI.Notify.addNotification('Request failed. ' + sender.statusText + '\n' + sender.statusCode);
    } else {
        SP.UI.Notify.addNotification('More than 1 item'false);

After the success Message from the last operation, you can refresh the Permission Level Page and validate if the new RoleDefinition was created with sucess.

For the ExportImport App Project you can access the following link: 

Hope you like this Article, 
Kind regards, 
André Lage

Wednesday, October 01, 2014

Microsoft Power Query for Excel - Easy access to Office 365 data and other connectors

Today i tested the new version of the "Microsoft Power Query for Excel Plug-in" and have to say "Microsoft did a brilliant work on call External data from Excel".
Here where you can download the "Microsoft Power Query for Excel

This is a "must-have" in every Excel document.

I used, tested and love it, if you work heavily with excel this is a plug-in to have in Excel Document and will be very useful to call external data.

Access your SharePoint List data stored in Office 365 with Plug-in
Here a little manual on how we can access to sharePoint data using the Plug-in in Excel.

Install the plug-in to Excel 2013 "Microsoft Power Query for Excel" and open the excel.
Select the Ribbon "Power Query" and select the option "From Other Sources > From SharePoint List", this option will open a conection to your Office365.

Select the SharePoint Url where is located the List data you want to manage in the Excel file.

Select the type of authentication since this is Office 365, select tthe option "Organization Account" and "sign in" with your Office365 account. This credential will be stored and used to access Office365 data.

After the authentication is made with success a new option call "Navigator" appear where is listed all Lists from the SharePoint Site.

In this option you are able to select your List datasource, for this example i used a List call "PLXRecyclingBin" where i store my UserCustomActions for maintenance and select the option "Edit" to manage the datasource.

Query Editor

When the Query Edit is selected a new dialog form is open where we have multiple options "select Columns, Grouping, Split, Counts, Merge Query, etc etc" that help the Management of the data, super powerful

Choose Columns

One of the option we can use in the Query editor is the column selector where columns of the List are displayed and we can choose what should be shown. 

Group By 

Another great option is the "Group By", this option provide View where we can group by field and define operations asscoiated for this case was select "Count Rows".

Workbook Query 

After the query editor is finish need to cose and the new view appears in excel with te defined content, easy easy.... even with preview in the Datasource.

Select Multiple Lists

The add-in is so powerfull that is possible call mutliple List and make possible connections between them, but that is another article. 

Power Query Connector Views

Here a view of the existing connectors "SharePoint, Office 365, Active Directory, Odata, Azure, Exchange, Facebook also?!?!...."

Hope you like this article,
Kind regards,
André Lage

Monday, September 29, 2014

New features released for app Processlynx Custom Action and Ribbon Manager

As defined in the roadmap for the Processlynx Custom Action and Ribbon Manager a new list of features are launched that could help site administrators and developers to create their Customization in SharePoint Site, this tool has been very usefull to support my custom solution using Office 365 and SharePoint on-premise environments where is not possible to access Farm solutions and Sandbox solutions are not allowed. 
To better support the client requirements and don't break the customer policies and avoid endless time and documentation for deployment of solutions this app has support me to better response Collaborative enviroments in big corporations with very restricted environments 

For more infor about the 

Processlynx Custom Action and Ribbon Manager:

Processlynx Custom Action and Ribbon Manager Demo "Office Store": 

Processlynx Custom Action and Ribbon Manager new features:

  • Versioning and Restore of UserCustomActions
  • Export of UserCustomAction Metadata using JSON
  • Import of UserCustomAction using JSON
  • Prefix and Suffix in UserCustomAction Names
  • Copy of existing UserCustomAction
Here a list of all features from the App:

Create User Custom Actions
The app Manage the User Custom Action, this new model helps site administrators and developers to create their new solutions in SharePoint sites when there is not access to Farm Solutions or in Office365 enviroments.
Ribbon Manager Editor
The app provide a user friendly interface to create complex custom Ribbons with Code and images associated.
Recycling Bin (host-web and app-web)
The app provide a Recylcing bin where administrators can delete the User Custom Action and restored. The recycling bing can be located and defined as "Host-web" or "App-web".
Language Support
The app supports the following languages:

  • English
  • German
  • French 
  • Portuguese
Code Source Editor
The app uses a code source editor to help developers to create their custom Action code that could be associated to items/links/actions in the SharePoint Custom Actions/Ribbons
App Log
The app provides and Log feature that helps Administrator to track possible permissions or code issues in the solution.
Copy User Custom Actions
This option copy existing User Custom Action and provides a form for the new User Custom Action.
Export/Import User Custom Actions
This Export/Import option uses JSON structure to Export/Import the content of the user Custom Actions. This exported JSON can be used to import the Custom Action in other SharePoint sites using a very simple user interface.
Prefix and Suffix User Custom Actions
The App provides interfaces where users can define Prefix and Suffix for new User Custom Actions using the App solution.
This can be useful to manage custom action created by the tool and separate from external Custom Actions.
The app provides 2 different views of the User Custom Actions with Modern UI View and Table View. 
Theme integration
The app uses the same Theme from the Host-web site to better integrated the look and feel of the solution to the SharePoint Site.
The app provides a simple help for the creation of the custom actions and ribbon using the interface from the solution.

Versioning and Restore of UserCustomActions

This new feature list all User Custom Action versions with their changes, it's is possible to restore the different version with the associated code.

Export of UserCustomAction Metadata using JSON

This feature export the JSON data of the User Custom Action, this content can be used to export complex User Custom actions for example Ribbon with complex strucutre and code associated.

When the option is selected the JSON data is display in a new form to be copy and content changed.

Import of UserCustomAction using JSON

This feature import the JSON data of the User Custom Action, this content can be used to create complex User Custom actions for example Ribbon with complex strucutre and code associated from existing User Actions in SharePoint Site.

Pick the exported JSON data used from to export the existing content of the User Custom Action and paste in the "Import User Custom Action" form.
After click save a new User Custom Action should appear in app View.

Prefix and Suffix in UserCustomAction Names

This option give the site administrator/developer to create complex Custom Actions using the app and define by default a Prefix and Suffix Name when a new action is created.
This feature can be useful when you need to manage Multiple Custom Actions. the option helps you to define the ones created by the App and the others created by external features.

When the option is selected in the configuration tab, a new form appears where you can add the Prefix and Suffix of the new User Custom Actions created by the tool.
For this example was created a user custom action by the App call "Example" with a simples script.

After the Action is created should be displayed in the view with the Title of the Action.

When the edit option is selected the CustomAction the Name propertie is changed with the Prefix and suffix defined in the new configuration option:

Copy of existing UserCustomAction

This action can be useful to reuse/recreate complex custom actions/Ribbon and make the necessary changes to better response the client needs.

When the option is selected a Form is create where the site administrator/developer can provide a new name for the Custom Action.

After the Title is added the copy User Custom Action should appear in the view of the app.

Hope you enjoy this new article,
Kind regards, 
André Lage

Wednesday, September 24, 2014

It is SharePoint Permission call FullMask or "NearFullMask" in CSOM?

This Post is about SharePoint JSOM and RESt and how SharePoint deals with FullMask Permission in Client Side Object Mode and what means High and Low Properties in BasePermission Object on SharePoint Object Model.

This topic was first talked and promissed in the following post:
How to Convert REST Call to SharePoint JSOM Object (ECMAScript)

when we configure permission of user permission it is possible to define some type of permissions templates to users or some Web Object like "UserCustomActions", the same way we do with declarative XML.
But when i was making and my SharePoint App "SharePoint App Processlynx Custom Action and Ribbon Manager Launch" and was validating the permission field found out that FullMask is not really FullMask.... here are my findings.

Here are the results about the “BasePermissions” Issue in SharePoint Client Object Model (SP.BasePermissions) and REST:

This are the values of all possible “PermissionKinds” im SCOM (split in two parts – the low and high “PermissionKinds”) :
For the low “PermissionKinds” from 1 to 32:
01: 0000000001: 0000000000000000000000000000001: ViewListItems
02: 0000000002: 0000000000000000000000000000010: AddListItems
03: 0000000004: 0000000000000000000000000000100: EditListItems
04: 0000000008: 0000000000000000000000000001000: DeleteListItems
05: 0000000016: 0000000000000000000000000010000: ApproveItems
06: 0000000032: 0000000000000000000000000100000: OpenItems
07: 0000000064: 0000000000000000000000001000000: ViewVersions
08: 0000000128: 0000000000000000000000010000000: DeleteVersions
09: 0000000256: 0000000000000000000000100000000: CancelCheckout
10: 0000000512: 0000000000000000000001000000000: ManagePersonalViews
12: 0000002048: 0000000000000000000100000000000: ManageLists
13: 0000004096: 0000000000000000001000000000000: ViewFormPages
17: 0000065536: 0000000000000010000000000000000: Open
18: 0000131072: 0000000000000100000000000000000: ViewPages
19: 0000262144: 0000000000001000000000000000000: AddAndCustomizePages
20: 0000524288: 0000000000010000000000000000000: ApplyThemeAndBorder
21: 0001048576: 0000000000100000000000000000000: ApplyStyleSheets
22: 0002097152: 0000000001000000000000000000000: ViewUsageData
23: 0004194304: 0000000010000000000000000000000: CreateSSCSite
24: 0008388608: 0000000100000000000000000000000: ManageSubwebs
25: 0016777216: 0000001000000000000000000000000: CreateGroups
26: 0033554432: 0000010000000000000000000000000: ManagePermissions
27: 0067108864: 0000100000000000000000000000000: BrowseDirectories
28: 0134217728: 0001000000000000000000000000000: BrowseUserInfo
29: 0268435456: 0010000000000000000000000000000: AddDelPrivateWebParts
30: 0536870912: 0100000000000000000000000000000: UpdatePersonalWebParts
31: 1073741824: 1000000000000000000000000000000: ManageWeb
65: 0000065535: 0000000000000001111111111111111: FullMask

And for the high “PermissionKinds” from 33 to 64:
37: 0000000016: 0000000000000000000000000010000: UseClientIntegration
38: 0000000032: 0000000000000000000000000100000: UseRemoteAPIs
39: 0000000064: 0000000000000000000000001000000: ManageAlerts
40: 0000000128: 0000000000000000000000010000000: CreateAlerts
41: 0000000256: 0000000000000000000000100000000: EditMyUserInfo
63: 1073741824: 1000000000000000000000000000000: EnumeratePermissions
65: 0000032767: 0000000000000000111111111111111: FullMask

As you can see the “FullMask” don’t cover all permissions. In the low “PermissionKinds”, the permissions from “Open” to “ManageWeb” and in the high PermissionKinds, the permission “EnumeratePermissions”, are not included.

The “FullMask” should be like this to cover all “PermissionKinds”:
65: 2147483647: 1111111111111111111111111111111: FullMask

To only cover all now available permissions, the “FullMask” could be also like this:
For the low “PermissionKinds”:
65: 2147425279: 1111111111111110001101111111111: FullMask

And for the high “PermissionKinds”:
65: 1073742320: 1000000000000000000000111110000: FullMask

In the (Server) SharePoint Object Model (Not Client) everything is correct:
0000000000000000001: 000000000000000000000000000000000000000000000000000000000000001: ViewListItems
0000000000000000002: 000000000000000000000000000000000000000000000000000000000000010: AddListItems
0000000000000000004: 000000000000000000000000000000000000000000000000000000000000100: EditListItems
0000000000000000008: 000000000000000000000000000000000000000000000000000000000001000: DeleteListItems
0000000000000000016: 000000000000000000000000000000000000000000000000000000000010000: ApproveItems
0000000000000000032: 000000000000000000000000000000000000000000000000000000000100000: OpenItems
0000000000000000064: 000000000000000000000000000000000000000000000000000000001000000: ViewVersions
0000000000000000128: 000000000000000000000000000000000000000000000000000000010000000: DeleteVersions
0000000000000000256: 000000000000000000000000000000000000000000000000000000100000000: CancelCheckout
0000000000000000512: 000000000000000000000000000000000000000000000000000001000000000: ManagePersonalViews
0000000000000002048: 000000000000000000000000000000000000000000000000000100000000000: ManageLists
0000000000000004096: 000000000000000000000000000000000000000000000000001000000000000: ViewFormPages
0000000000000008192: 000000000000000000000000000000000000000000000000010000000000000: AnonymousSearchAccessList
0000000000000065536: 000000000000000000000000000000000000000000000010000000000000000: Open
0000000000000131072: 000000000000000000000000000000000000000000000100000000000000000: ViewPages
0000000000000262144: 000000000000000000000000000000000000000000001000000000000000000: AddAndCustomizePages
0000000000000524288: 000000000000000000000000000000000000000000010000000000000000000: ApplyThemeAndBorder
0000000000001048576: 000000000000000000000000000000000000000000100000000000000000000: ApplyStyleSheets
0000000000002097152: 000000000000000000000000000000000000000001000000000000000000000: ViewUsageData
0000000000004194304: 000000000000000000000000000000000000000010000000000000000000000: CreateSSCSite
0000000000008388608: 000000000000000000000000000000000000000100000000000000000000000: ManageSubwebs
0000000000016777216: 000000000000000000000000000000000000001000000000000000000000000: CreateGroups
0000000000033554432: 000000000000000000000000000000000000010000000000000000000000000: ManagePermissions
0000000000067108864: 000000000000000000000000000000000000100000000000000000000000000: BrowseDirectories
0000000000134217728: 000000000000000000000000000000000001000000000000000000000000000: BrowseUserInfo
0000000000268435456: 000000000000000000000000000000000010000000000000000000000000000: AddDelPrivateWebParts
0000000000536870912: 000000000000000000000000000000000100000000000000000000000000000: UpdatePersonalWebParts
0000000001073741824: 000000000000000000000000000000001000000000000000000000000000000: ManageWeb
0000000002147483648: 000000000000000000000000000000010000000000000000000000000000000: AnonymousSearchAccessWebLists
0000000068719476736: 000000000000000000000000001000000000000000000000000000000000000: UseClientIntegration
0000000137438953472: 000000000000000000000000010000000000000000000000000000000000000: UseRemoteAPIs
0000000274877906944: 000000000000000000000000100000000000000000000000000000000000000: ManageAlerts
0000000549755813888: 000000000000000000000001000000000000000000000000000000000000000: CreateAlerts
0000001099511627776: 000000000000000000000010000000000000000000000000000000000000000: EditMyUserInfo
4611686018427387904: 100000000000000000000000000000000000000000000000000000000000000: EnumeratePermissions
9223372036854775807: 111111111111111111111111111111111111111111111111111111111111111: FullMask

In the “Microsoft.SharePoint.Client.dll”  there is a limitation value in the BasePermission” class:
In the function “Set”:

And in the function “Has”:

So the possible value of “FullMask” must be increased for the high values from 32767 to 2147483647 and for the low values also from 65535 to 2147483647 to cover all permissions or for the high values from 32767 to 1073742320 and for the low values also from 65535 to 2147425279 to cover only the now available permissions.
Only then the “PemisionKind FullMask” will really cover all available permissions.
But maybe Microsoft for security reasons limited this values....

Thanks to my colleague “Selim Gezgin” for collecting all this info about this topic.

Kind regards, 
Andre Lage