0

Is it possible to restrict a Custom Action for a list so that only Admins (they will have the ApproveItems permission) and the item author can run it via the Rights Mask field?

Background

I have a calendar that any user can create items, it is set via the Advanced settings on the list that only the user who created an item can edit an item. Admins will then approve/reject this via a workflow and task.

However, I only want admins or the author to be able to delete an event but I wish to capture a reason for the deletion. To achieve this, the idea was to prevent deletions and have a custom action that will start a workflow.

This workflow has an initiation parameter (free text multi line) that enables the cancelling user to enter a reason for the cancellation, the workflow will then email all admins and the event author with the reason for cancellation. The workflow will then delete the item (within an impersonation step). This workflow works fine also.

The issue is restricting the custom action so that only the admins and the event author can run it or see it. Any suggestions or different approaches to achieve this goal?

Currently, I am trying to achieve this through SharePoint Designer however I am happy to use Visual Studio if that provides the solution...

Thanks in advance

0

Ok, so after looking around more it appeared that a ListItem action could not be restricted to only approvers and the item author.

As my action was going to start a new workflow, I moved the logic check to the workflow. So my cancel workflow now reads (in pseudo code) something like:

Step 1
    If Workflow.Initiator is CurrentItem.CreatedBy or Workflow.Initiator is Member of AdminGroup Then
        Send Email informing of deletion with reason
        Set variable 'do_delete' to true
    Else
        Send Email informing user why they are not allowed to delete

Impersonation Step
    If 'do_delete' is True Then
        Delete current item

The check for whether user is the author or member of the specified group is a custom developed workflow activity that I developed that will return the required result.

Not an ideal answer or solution to restricting a ListItem action to only an author but enabled what the customer wanted.

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.