Showing posts with label Open Source. Show all posts
Showing posts with label Open Source. Show all posts

Tuesday, May 29, 2018

Microsoft tech support fails the open source community

Scenario
  • Open an O365 support ticket with Microsoft to notify them of a bug in their product.
  • Detail everything Microsoft needs to know to fix the problem in an email
    • In a recent case it was simply due to the Microsoft release engineer failing to deploy 2 files (CSS and PNG) from the Office 365 release to the CDN.
      • This effected tenants utilizing the CKEditor open source JavaScript class library, breaking the functionality for released web parts.  (Part of the SPfx 40)
Issues
  • Tier 1 support calls you and wastes an hour (or more) of your time making you go over the same steps provided in the email.
    • In the recent case it was literally as easy as clicking a link and getting a 404 error.
      • Here is the link to the Open Source product that Microsoft broke and the users who took the time to report it: https://github.com/OlivierCC/spfx-40-fantastics/issues/29
  • Tier 1 support says they can't support this because it is a programming issue and wants you to open a paid ticket to fix their own product issue.
Proposed Resolution
  • Microsoft needs a better way to escalate tickets from members of the community who are trying to help out and know what they are doing without having to go through tier 1 engineers or paid support.

Tuesday, July 19, 2016

Restricted Edit Event Receiver - SharePoint 2013

Scenario
  • You need to restrict edits to a document library based on the current value of a field.
  • Full trust farm solution for SharePoint 2013 scoped to Web.
Solution
  • I created a configurable event receiver that will restrict edits (metadata and content) based on the value in one of the document's metadata columns.
  • Additional feature: Delay implementation of the restriction for a number of seconds from Created Date to allow for additional automated processes to update new documents.
  • Additional feature: Exclude a document from the restriction based on a regular expression using its  filename.
  • Additional feature: Automatically populate the Title field (or other text field) based on another choice or text field.
  • Open-Source code is available here:  RestrictedSave ZIP
    • Feel free to modify and use this code.  You may not resell it or a modified version of it as part of a packaged solution without my permission.
  • Disclaimer:  This will only prevent edits that trigger the item updating event receiver.  Some programmatic and 3rd party API calls made using bulk edit operations, workflow actions, or other event receivers may bypass the event receiver.  In addition, this code is not hardened for high security scenarios and is only meant as a first line defense against unwanted typical user edits.
Installation
  • Download the RestrictedSave WSP file and deploy to your farm.
  • Enable the Restricted Save feature on your sub-site.
    • Feature Description:
      Configured via the RestrictedSave list. If this site does not have one, a RestrictedSave list will be added. Document libraries named in the RestrictedSave list will not save a file if the user is unauthorized and the assigned column contains a certain value. If no required permission is specified, then the field can only be edited if the restricted column's value is changed. Multiple document libraries, columns, or values may be configured but must exist in this subsite. Optional New File Delay and Regular Expression Exclusion may be configured as well. Will also set the document title and/or filename based on a choice field by using the 'Title Choice Field' columns.
  • Configure the RestrictedSave list that was added to the site according to your needs.
Example

  • A standard configuration of the RestrictedSave list to restrict edits on a document library named "RestrictDeleteTest" when the "LOBType" column is set to "Choice 1".

  • The resultant error displayed on a document's edit properties form in the "RestrictDeleteTest" library when a filename modification is attempted.


  • Error Message in clear text
UNABLE TO SAVE! -- When column "LOBType" is set to "Choice 1" the item is locked and cannot be updated. -- Please work from a new copy or change the column value.





RestrictedSave List Configurable Fields
  • Instructions are provided in-line on the form.
  • Add one line for each restriction.  All lines will be parsed for each document edited in the sub-site.

--------------------------------------------------------------------------------------


And again in text format for search-engines, visually impaired, and copy/paste:

Document Library Name *


Column Name


Column Value


Required Permission To Edit

   

New Item Delay Seconds


Title Exclusion Regex


Title Choice Field Name


Title Choice Target