Sharing items with others

In IJC there are basically 2 categories of items:

Items that are shared between all users

Some things in IJC are shared amongst all users. That is all users see exactly the same thing(s), and a change made by one user will be reflected in what all other users see. Examples include:

  • Schemas

  • Entities

  • Fields

  • Data Trees

Because modifications to these items affects all users, there need to be restrictions in place to ensure chaos does not take over:

  • Access controls restrict modifications to authorised users.

  • Some operations are restricted to single user mode to prevent bad things happening for other users (e.g. if a database table is deleted).

Items that belong to an individual user

Other things in IJC belong to the individual user. Examples include:

  • Views (e.g grid view or form view)

  • Queries

  • Lists

  • Scripts

Each user needs their own items here so that they can create, modify or delete them as they need. For instance, even the apparently simple operation of adjusting the width of a column in the grid view changes its definition and needs that change to be saved. As each user will want to have their own settings these have to be independent, and so each user needs their own particular copy.

However this introduces a new problem - what if a user wants to share a view, list or query with other users? For instance, a common scenario would be for an administrator to want to prepare a set of forms, queries and lists that all users can use.

Giving ownership to another user

The owner of an item can give ownership to any other user. In the right-click menu, click the Give ownership... function. The following window will open:

images/download/attachments/43894471/image2014-6-30_16_57_34.png

Approaches to sharing in IJC

IJC has 2 approaches to addressing this problem.

Copying items

With this approach a user can take a copy of any view, query or list and can then treat it as their own. Once copied the item has no knowledge of the original item, and changes in the two items are completely independent. Users can make whatever changes they want to the copied item.

Sharing items

With this approach one user can allow a view, query, list or script to be shared, which means that all users will see the item and can use it. But in this scenario the owner of the item will not want any changes to be made to the item, so IJC does not save any changes that other users might subsequently make to the item. Any changes are therefore transient in nature and will be lost when IJC is closed. This approach allows the user who is using the shared item to make temporary changes to things like display settings of a view without permanently changing these settings for the owner of the item or other users who might be sharing it.

Of course sometimes you would want your changes to be permanent so that you can continue with them next time you start IJC. When an action occurs that would have caused a change to the shared item, the user is prompted as to whether they want to copy the item and work with the copy, or to continue to work directly with the shared item. This dialog will appear the first time in a session that a change would be happening. You will not be prompted again during that session, and you can specify to never be prompted again with this dialog (the setting can later be changed in the user settings).

Alternatively, if you know you want to work with a copy of the shared item then you can make a copy of it at any time. For a view you can do this by duplicating the current shared view, in which case you have created a copy that is now your own view and you can make whatever changes you want and save these so that they will be reloaded when you restart IJC.

A query can effectively be duplicated by applying it, which will create a new temporary query that is identical to the original.

Similarly a list can effectively be duplicated by applying the list to a view and then saving the current records back to a new list.

Item visibility

Sharable items have 3 levels of visibility:

  1. Public (default). Item is owned by you but can be copied by at least some users which have a required role.

  2. Private. Item is owned by you and is not visible to any other users.

  3. Shared. Item is owned by you and a read-only version is seen by at least some users which have a required role.

These different levels of visibility are depicted on the icons for the item using badges as illustrated for lists (the same applies to queries and views):

images/download/attachments/43894471/sharing-badges-lists.png

In top-to-bottom order the badges indicate:

  1. Private, not visible to other users.

  2. Shared, owned by you, can be read and copied by others.

  3. Public, owned by you, but can be only copied by others (no badge).

  4. Shared, owned by user, can be used and copied by you.

The visibility of an item can be changed by this methods:

Using the sharing action in the list/query/view popup menu. Right-click on the icon in the projects window (for views) or the Lists and queries window (for lists and queries - note: only permanent lists and queries can have their visibility changed) and choose the 'Share...' menu item. This will open a dialog allowing you to specify the level of sharing with the given user role.

images/download/attachments/43894471/view-list-query-sharing.png

Limitations of sharing that may be addressed in future versions of IJC

  • Lists, queries and scripts cannot be directly duplicated (see above workarounds), but can be easily copied from an another user if they are public - visible.

  • Sharing of the items cannot be restricted to a specific users - only the user roles can be specified (since v5.12).