Change Annotation Layer Ownership

Overview

As Annotation Layers are owned by the users who create them, access to these Layers could be denied under certain circumstances. In order to re-gain access to these Annotation Layers you simply need to run a couple of SQL statements on the annotations schema in the iShare database to change the ownership of these layers. Depending upon the reason for your access issues please refer the the relevant sections below.

i.e. If

Step-by-step guide

There are two ways of running these scripts, either through pgAdmin or by using a Workflow Stored Procedure Task in Studio using the at_wkf_executecmd function (from v6.0.0 this is called wkf_executecmd under the -Workflow- Function filter). 

For safety backup the annotations schema in pgAdmin before running these scripts.

Changing the User Domain

If all you need to do is to change the Domain for the Users then you can use the following script which will update records for all Users with the old_domain to the new_domain.

Please replace new_domain with the new domain for your Users and old_domain with the original domain.

This script will perform the following:    

  1. Update the annotations.layers table to change the owner and lasteditedby values.

  2. Update the annotations.layers_access table for where the user may have access to Annotation Layers created by other people.

Replace one User with another User

If a User has left the company and you want to update all of their Annotation Layers to be owned by another User then you can use the following script. This will update all records owned by the old_user to be owned by the new_user.

Please replace new_user@domain with the user and domain that you wish to now own the Annotation Layer and old_user@domain with the name of the original owner.

This script will perform the following:    

  1. Update the annotations.layers table to change the owner and lasteditedby values.

  2. Update the annotations.layers_access table for where the user may have access to Annotation Layers created by other people.

  3. After this has been done we then need to make sure that there are no annotations.layers where the owner also has an entry in the annotation.layers_access table.