3

we're very new to SP 2013 hence the basic question. We uploaded a small user guide for SP2013 and shared it with everyone. This means that anyone can download it, or the permissions are even greater and they can edit it ? Can we have certain uploaded document read-only and when shared with everyone to have them following it by default ? Or is there any other method to achieve similar thing?

4

There are two main concepts in how you can make this work, following the article of Olivier Carpentier "How to add programmatically users as followers with new SPSecurityEventReceiver in SharePoint 2013" we learn that:

One of the behavior of this feature is that if you're adding someone as a user in this web site (for example, you're adding a user as a site member), this user is not automatically a follower, because out-of-the-box following a content is a self user action.

However, this can be solved by using SPSocialFollowingManager:

The first one is the extended Social API. There are a lot of new classes that you can use get or set data about social activities. For example, the new SPSocialFollowingManager provides methods to programmatically manage followers.

Adding the user profile to the SPSocialFollowingManager, followed by a new instance of an SPSocialActorInfo (containing all the properties as ContentUri, AccountName and ActorType) and finally update the manager.Follow with the updated actorInfo instance, like the following:

    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        //Get the UserProfil for target user
        SPServiceContext serverContext = SPServiceContext.GetContext(properties.Web.Site);
        UserProfileManager profileManager = new UserProfileManager(serverContext);
        UserProfile profile = profileManager.GetUserProfile(targetUser.LoginName);
        if (profile != null)
        {
            //Inits the social following manager for the profile
            SPSocialFollowingManager manager = new SPSocialFollowingManager(profile);

            //Init the social actor with current web 
            SPSocialActorInfo actorInfo = new SPSocialActorInfo();
            actorInfo.ContentUri = new Uri(properties.WebFullUrl); // change to Document URI
            actorInfo.AccountName = targetUser.LoginName;
            actorInfo.ActorType = SPSocialActorType.Site; // Change to SPSocialActorType.Document; 

            //Follow on this actor
            manager.Follow(actorInfo);
        }

    });

Beware though that this code regards a site, but if you change the ContentUri to point to a document instead as well as changing the ActorType property to Document instead of Site, you should be able to force users to follow a document.

1

If you are a contributor and share the document with others you cannot choose the level of the privileges (read, contribute, full control, etC). The owner is the one who chooses the permission level in Access Request page Only. But, if you are the owner, a dropdown list is enabled with several options.

Without code there is no OOTB functionality that covers what you are asking for.

You could createa custom context menu for the document that Share and follow the document. Check this page to see how to create a context menu. http://sanjivblog.wordpress.com/2011/08/17/create-custom-context-menu-in-sharepoint-document-library/

0

If you only want certain people editing the document you need to specify the permission.
To understand user permission, you can read the following:
http://technet.microsoft.com/en-us/library/cc721640.aspx

I am not sure if you can make all users follow a document by default without any code, but what you can do is setup Alerts for users on that document.
http://www.fpweb.net/support/microsoft-sharepoint/tutorials/sharepoint-2013/alerts/create-new-alert/#

Regards,
JP

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.