Weekend research time again! it was about Calendars in SharePoint Online.

This was what we needed-

Students have access to their school sharepoint online site. Site has a calendar that they should use to add homeworks/ other agendar items. When a student logs in to the site they should just see their entries and not others.

Sounds simple enough eh! It is too, if you know where to look for solution. 🙂

Item level permissions can be set via Workflows in lists/libraries in SharePoint. In our environment workflows can be created either by using

  • SharePoint designer 2013  or
  • Nintex workflow for Office 365

For this solution, I chose to go with SharePoint to enable custom workflow permission designer 2013 to create a SharePoint designer 2010 workflow(I know, its kinda weird, but hey this works so no questioning, just go with it OK!) and an Impersonation Step action in the workfllowAddNewWorkflowForStudentCalendar

Create a calendar in your SharePoint Online site(duh!)
Create a custom SharePoint group in your site, to store the list of your school students for whom you would like to provision the homework-calendar.
CreateSPGroupForStudents

In the image below, I have left the permissions default, you could customize it to further control the group access as you see fit in your environment. Edit permission rerquired to submt calendaar entry.

DefaultGroupOptions

“ListOfStudentsUsingCalendar” SharePoint group has Edit permission to the list.

StudentsToEditCalendar

Add all your students to this groupAddStudentsToGroup

This step is optional, but in case you wish to customize the permission further, make sure that you leave just the students group and a owners group in the calendar permission.  In this example I left the site owners group as well as ListOfStudentsUsingCalendar group and removed the rest. To do this, you have to open the Calendar Settings

First stop inheriting permission. To do that, List Settings > Permission for this list > STOP inheriting permission

PrunePermission

Remove the groups that are not required.PruneGroups

Edit the calendar clicking SharePoint Designer 2013 icon in menu bar of calendar

In the calendar that opens in designer, click New in workflow section to add your calendar workflow as seen in the image below.
AddNewWorkflowForStudentCalendar

Give it a name and describe what you want to do in the description text box. Most important step here is to select the Platform Type as SharePoint 2010 workflow

StudentCalendarWorkflowSetup

Now, you can start customizing the workflow steps. Woot!

Add Impersonation Step right above the default Step 1 action.

  1. Type Inherit and select Inherit parent permission for item in this list to Current Item
    IneritParentPermission
  2. In the next workflow step, you need setup custom permission for the calendar entry created by the student. You can do this by clicking Edit hyperlink in action ‘then Add Edit to item in Current Item option’, Add List Item Permission pop-up window opens,
    EditPermissionForStudentWhoCreatedTheCalendarEntry
  3. Next workflow step, you need to remove Edit permission for the Students SharePoint group
    RemovePermissionsForStudentsSharePointGroup
  4. You can include log messages in between steps, to track what steps gets completed.
  5. Now whenever a student submits entry in the calendar, this workflow sets the custom permission
    1. Adds edit permission for the student who created calendar entry.
    2. Removing Edit for your ListOfStudentsUsingCalendar SharePoint group

Thats all! In the image below you can see that Test R.Student cannot see, Test S. Students entry and vice versa.

TestRStudent

TestSStudent

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s