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>

Friday, January 29, 2016

Copy-SPSite: Rename/Recreate SharePoint site collection in SharePoint 2013

In SharePoint 2013 ,

 Copy-SPSite command :


Copy-SPSite Source Site URL [-DestinationDatabase Destination DB] -TargetUrl Target Site URL

 Remove-SPSiteUrl command:


Remove-SPSiteURL -URL Host named Site collection URL

Display name Change in site collection SharePoint

We need to remove the user from all users list and read it to the list.

When I remove and add the data in SharePoint site group, SharePoint site collection user details from all users 


/_layouts/people.aspx?MembershipGroupId=0



Sunday, December 27, 2015

How to programmatically get permissions for list using client object model SharePoint 2013

//Get the lists

ClientContext clientContext = new ClientContext(_siteurl);
clientContext.AuthenticationMode =ClientAuthenticationMode.Default;
clientContext.Credentials = new System.Net.NetworkCredential
(“peakfinders”, “password@1”, “peakfinders”);
Web oweb = clientContext.Web;

            List myList = 
oweb .Lists.GetByTitle("Employee");

            roles = 
oweb.LoadQuery(
            myList.RoleAssignments.Include(
            roleAssign => 
roleAssign.Member,
            
roleAssign=> roleAssign.RoleDefinitionBindings.Include(
            roleDefine => 
roleDefine.Name, // for each role def, include roleDef’s Name
            
roleDefine=> roleDefine.Description,
            
roleDefine=> roleDefine.RoleTypeKind,
            
roleDefine=> roleDefine.BasePermissions)));
            
clientContext.ExecuteQuery();

            Dictionary dicpermission= new Dictionary();

            foreach (RoleAssignment ra in roles)
            {
                var rdc = ra.RoleDefinitionBindings;
                string permission = string.Empty;
                foreach (var strrp in rdc)
                {
                    permission += 
strrp.Name.ToString() +","+ strrp.Description.ToString() +","+ strrp.RoleTypeKind.ToString()+","+ strrp.BasePermissions.ToString();                  
                }
                
dicpermission.Add(ra.Member.Title, permission);

Wednesday, December 9, 2015

Programmatically Create SharePoint Toplink bar and Quicklaunch bar in SharePoint 2010 and 2013

Programmatically Create TopLink Bar in SharePoint site collection:

SPNavigationNodeCollection topnav = oweb.Navigation.TopNavigationBar;
SPNavigationNode node = new SPNavigationNode("Title", "URL");
node = topnav.AddAsLast(node);
node.Update();


Similarly, To create Quicklaunch bar

SPNavigationNodeCollection topnav = oweb.Navigation.QuickLaunch;
SPNavigationNode node = new SPNavigationNode("Title", "URL");
node = topnav.AddAsLast(node);
node.Update();

Programmatically Creating SharePoint Groups with Role

private static void AddGroup(SPWeb web, SPRoleType roleType, string groupName)
    {
        var groups = web.SiteGroups;

        var userGroup = FindSiteGroup(web.Site, groupName);

        if (userGroup == null)
        {
            groups.Add(groupName, web.CurrentUser, null, string.Empty);
            web.AssociatedGroups.Add(web.SiteGroups[groupName]);
        }

        var grp = web.SiteGroups[groupName];
        grp.OnlyAllowMembersViewMembership = false;
        grp.Update();

        if (roleType != SPRoleType.None)
        {
            var asgn = new SPRoleAssignment(web.SiteGroups[groupName]);
            var roleDef = web.RoleDefinitions.GetByType(roleType);
            asgn.RoleDefinitionBindings.Add(roleDef);
            web.RoleAssignments.Add(asgn);
        }

        web.Update();
    }
__________________________________________________
SPRoleDefinition role = oweb1.RoleDefinitions[0]//Fullcontrol
SPRoleDefinition role = oweb1.RoleDefinitions[1]//design
SPRoleDefinition role = oweb1.RoleDefinitions[2]//Edit
SPRoleDefinition role = oweb1.RoleDefinitions[3]//Contribrute
SPRoleDefinition role = oweb1.RoleDefinitions[4]//Read
SPRoleDefinition role = oweb1.RoleDefinitions[5]//Limited Access
SPRoleDefinition role = oweb1.RoleDefinitions[6]//Approve
SPRoleDefinition role = oweb1.RoleDefinitions[7]//View Only
_______________________________________________________

Tuesday, October 6, 2015

SharePoint Shortcut URL / Important application Pages in SharePoint

People
/_layouts/15/people.aspx

Permission
/_layouts/15/user.aspx

Create Group
/_layouts/15/newgrp.aspx

Permission Levels
/_layouts/15/role.aspx

Site Content Types
_layouts/15/mngctype.aspx
Site Columns
/_layouts/15/mngfield.aspx
Site content and structure  page (Added by @Dnyag):
/_layouts/sitemanger.aspx

Site settings page (Added by Aowworld):
/_layouts/settings.aspx

View all site content page (Site content) (Added by Aowworld):
/_layouts/viewlsts.aspx

Sandboxed Solution Gallery:
/_catalogs/solutions/Forms/AllItems.aspx

Workflow history hidden list:
/lists/Workflow History

Filter toolbar for Lists and libraries (Added by Asimaili):
?Filter=1

Site usage page (Added by @Dnyag):
/_layouts/usage.aspx



Manage site collection features - CASE SENSITIVE
/_layouts/ManageFeatures.aspx?Scope=Site

Manage site features :
/_layouts/ManageFeatures.aspx

 Get the version of the SharePoint server (Patch level) :
 /_vti_pvt/Service.cnf

Web Part Maintenance Page :
?Contents=1

Show Page in Dialog View :
?isdlg=1

Application page for registering SharePoint apps :
/_layouts/15/appregnew.aspx

Save Site as a template :
/_layouts/savetmpl.aspx

Sign in as a different user :
/_layouts/closeConnection.aspx?loginasanotheruser=true

User Information List :
_catalogs/users/simple.aspx

Force displaying the user profile in the site collection :
/_layouts/userdisp.aspx?id={UserID}&Force=True

View size of all lists and libraries :
/_layouts/storeman.aspx

Quick Deploy List :
Quick Deploy Items/AllItems.aspx

Open Page in Edit Mode :
?ToolPaneView=2

Taxonomy Hidden List (MMS) :
Lists/TaxonomyHiddenList/AllItems.aspx

Enable SharePoint designer :
/_layouts/SharePointDesignerSettings.aspx

Welcome Page (Default page settings) :
/_layouts/AreaWelcomePage.aspx

Change Site Master Page :
/_layouts/ChangeSiteMasterPage.aspx

Page Layouts and Site Templates :
/_Layouts/AreaTemplateSettings.aspx

Master Pages library :
/_catalogs/masterpage/Forms/AllItems.aspx




Wednesday, August 5, 2015

Import and Export subsite in SharePoint 2013 Using PowerShell Script

 Add-PSSnapin Microsoft.SharePoint.PowerShell


 Export-SPWeb "http://raghu/sites/test/test1" –Path "C:\rm.cmp" -includeusersecurity

 Import-SPWeb "http://raghu/sites/test/test1" -path "C:\rm.cmp" -IncludeUserSecurity

Monday, May 18, 2015

Difference between Edit ,Contribute and Read SharePoint 2013 permission levels?


Edit:- Add, edit, and delete lists; view, add, update, and delete list items and documents.

- Contribute:- View, add, update, and delete list items and documents.

-Read:- Add, edit, and delete items in existing lists and document libraries. By default, this permission level is assigned to the Members group.