Showing posts with label Permission Levels in Sharepoint 2013. Show all posts
Showing posts with label Permission Levels in Sharepoint 2013. Show all posts

Tuesday, December 20, 2016

Which is the Front-end technologies for SharePoint Framework development?

Microsoft has clearly mentioned in their key notes, they are building the framework and it is related samples using KnockoutJs and ReactJs with Typescript. Since it is an open-source based development model, choosing the framework/technologies are completely our choices, based on our knowledge and requirements. Here I have listed out a few front-end technologies.
  1. Angular 1.x - https://angularjs.org/
  2. Angular 2 - https://angular.io/
  3. ReactJs - https://facebook.github.io/react/
  4. KnockoutJs - http://knockoutjs.com/
  5. Ember.Js - http://emberjs.com/
  6. Backbone.Js - http://backbonejs.org/
  7. Aurelia.io - http://aurelia.io/

Thursday, May 19, 2016

Set list item level permission in jsom (javascript object model)

ar siteUrl = '/sites/peakfinder';

function breakSecurityInheritanceChangeUser() {    
    var clientContext = new SP.ClientContext(siteUrl);
    var oList = clientContext.get_web().get_lists().getByTitle('Employee');    
    var itemId = 5;
    this.oListItem = oList.get_items().getById(itemId);    
//Break Role Inheritance
    oListItem.breakRoleInheritance(true);    
//Get user from the site
    this.oUser = clientContext.get_web().get_siteUsers().getByLoginName('peakfinder\\testuser1');    
    oListItem.get_roleAssignments().getByPrincipal(oUser).deleteObject();    
    var collRoleDefinitionBinding = SP.RoleDefinitionBindingCollection.newObject(clientContext);

    collRoleDefinitionBinding.add(clientContext.get_web().get_roleDefinitions().getByType(SP.RoleType.administrator));
//assign the user
    oListItem.get_roleAssignments().add(oUser, collRoleDefinitionBinding);    
    clientContext.load(oUser);
    clientContext.load(oListItem);        

    clientContext.executeQueryAsync(Function.createDelegate(this, this.Success), Function.createDelegate(this, this.Failure));
}

function Success(sender, args) {    
    alert('Role inheritance broken for item ' + 
        this.oListItem.get_item('Title') + 
        ' and new role assignment for ' + 
        this.oUser.get_loginName());
}

function Failure(sender, args) {    
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}

Tuesday, April 26, 2016

Item Adding / Item Added Event Receiver for Document Library

In this below script, Item Adding / Item Added Event Receiver

Item Adding / Item Added Event Receiver In SharePoint
Ways to retrieve data are:

Properties.ListItem[«FieldName »]

Properties.AfterProperties[«FieldName »]

Properties.BeforeProperties[«FieldName »]


we must add the synchronization parameter


 to our xml definition.


<Receiver>
<Name>EventReceiver1ItemAdded</Name>
<Type>ItemAdded</Type>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>TutoTaxonomy.EventReceiver1.EventReceiver1</Class>
<SequenceNumber>10000</SequenceNumber>
<Synchronization>Synchronous</Synchronization>
</Receiver>
In our code we add an update of the column “test”


public override void ItemAdded(SPItemEventProperties properties)
{
base.ItemAdded(properties);
properties.ListItem["test"] = "test synchro";
properties.ListItem.Update();
}

Friday, March 18, 2016

Enable Anonymous Access in SharePoint 2013


  • Go to  Central Administration, Choose Application Management, select Manage web applications .
  • Select the site you want to enable anonymous access on and click on the Authentication Providers icon.
  • On the Authentication Providers pop-up window click on the Default zone.
  • Edit Authentication, Enable anonymous access and click Save.
  • Select Web Application Management click on the Anonymous Policy icon.
  • Under Anonymous Access Restrictions select your Zone and set the Permissions to None – No policy and click Save
  • Web application will allow anonymous access to be set. 
  • Navigate to your top level site collection for the web application. 
  • Site Actions > Site Settings. Under Users and Permissions click Site permissions
  • Permission Tools, Click Anonymous Access icon and set the permissions to Entire Web site

Friday, February 12, 2016

Hide Ribbons to the anonymous users?


Hide Ribbons to the anonymous users in SharePoint based on the PermissionsString ......

<SharePoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2" runat="server"
        PermissionsString="AddListItems" AuthenticationRestrictions="AuthenticatedUsersOnly">
     
 <script type="text/javascript">
            document.getElementById("s4-ribbonrow").style.display = "block";
            document.getElementById("suiteBar").style.display = "block";
     
        </script>

    </SharePoint:SPSecurityTrimmedControl>