Content Hub – defining self-referencing relations, creating, linking and displaying entities – part 1

What are relations

In Content Hub data modeling, relations are used to define how entities are linked together. One of the entity in this relationship will be a parent and the other will be a child. The relation can either

  • be between two different types, say M.AssetType and M.Asset
  • be of the same type, say between M.Asset entities. This type of relation is known as self-referencing

In Content Hub, it is recommended to name relations using the notation ParentEntityToChildEntity. For example AssetTypeToAsset, is a relation where M.AssetType is Parent of M.Asset. Conversely, M.Asset is Child of M.AssetType

In this blog post, I will dive more into self-referencing relations, how to define them, how to create entities and link them up as well as display them within Content Hub.

Defining self-referencing relation

We typically use self-referencing relation where you want to define some form of parent-child hierarchy within your entities of the same type. Let say we have a use-case where have a ‘master’ asset and we need to link related or supporting files, so that we can easily find all related or supporting files to master asset.

To define this, you will follow the following steps:

  1. From the dashboard, click on Schema and search and find M.Asset. Select to open the M.Asset definition management page.
  2. Click on ‘New member‘ button to launch ‘New member‘ popup below. Select Create a new relation to a non-taxonomy definition option
  3. This opens a window to capture the relation definition, conditions for the relation, whether it is mandatory among other configurations. This is similar to one below
  4. We will use the above dialog to define self-reference relation. As you can see, I have alread named my relation AssetToLinkedAsset, which mean M.Asset is Parent M.Asset, using the OneToMany cardinality. I will explain more about what is cardinality later in this blog.
  5. We will ignore defining any Conditional, Required and Advanced settings for now, we are going to use the default values, as shown below.
  6. Then click Save to create the relation. This will close the popup window and go back to the M.Asset definition management page.
  7. That is it, we have defined self-referencing relation. Ensure you click on Apply changes to commit changes on the M.Asset definition management page.
  8. If we refresh our M.Asset definition management page, you will notice we now have two relationships as shown below
  9. Content Hub will automatically generate two relations shown above, where M.Asset is Parent of M.Asset as well as M.Asset is Child of M.Asset. In fact, these fields are AssetToLinkedAsset:Parent and AssetToLinkedAsset:Child respectively within the M.Asset schema

What is relation cardinality

In Content Hub, we make use of cardinality to describes how parent and children are related. All values are from Parent => Child. Below are the supported cardinalities

  • OneToOne One parent to one child.
  • OneToMany One parent to many children
  • ManyToMany Many parents to many children.

The choice depends on your use case. In my current use case, I would like my ‘master’ asset to have one or more linked or supporting files, hence I have used OneToMany

Next steps

In this blog post, I have looked at what are self-referencing relations in Content Hub. I walked through a sample use-case for them, how to define them, and steps to follow within Content Hub. In the next follow up post, I will walk you through how to create and populate self-referencing entities and link them up to create parent-child hierarchy and to display this within Content Hub.

Stay tuned and leave us any feedback or comments.

Content Hub gems: Troubleshooting issue when creating asset public links

You may encounter this is error “The user does not have sufficient rights to create the specified entity

We will look at how to troubleshoot and resolve it. But first, what are public links?

What are public links used for?

In Content Hub, we use public links to share assets with external partners who typically do not have direct permission to download the assets. This means anyone who has access to this static URL can cache and fetch the file.

Creation of Public Links

I will start with a scenario where my Content Hub user doesn’t have permission to create public links. My user belongs to my GlobalContentCreator user group. Within Content Hub, on the Asset Details page, when my user tries to access the Public links menu, they notice it is missing as shown below.

The Public links menu is missing because the required permissions have not been configured within GlobalContentCreator user group. Below is a snippet of the existing permissions for M.Asset and M.File

You notice the CreatePublicLinks and ReadPublicLinks permissions are missing. We need to enable them first, as shown below:

With this change in place, the Public links menu now appears on the Asset Details page for my user, as shown below.

Does this resolve the issue?

I will now let my user to put this to test.

As expected, when my user clicks on the Public links menu, it opens New pubic link popup window. They proceed to fill out the form and submitting it as shown below. However, they are still getting the error. What is going on?

M.PublicLink permissions are needed as well

Asset public links are entities of type M.PublicLink. In fact, M.Asset is Parent of M.PublicLink (using the AssetToPublicLink relationship)

Therefore, I need to assign additional permissions for M.PublicLink. I need to update my GlobalContentCreator user group with the following changes:

The minimum permissions needed are Read and Create to create the public links. However, I have additionally allowed my users to update and delete them as well.

This is it. With this change, the issue is resolved and my users can happily generate public links. Happy days.

Next steps

In this blog post, I have explored steps you need to take to troubleshoot and resolve the issue “the user does not have sufficient rights to create the specified entity” when generating public links.

Stay tuned and leave us any feedback or comments.