FastComments.com

What is Access Control? Internal Link

With FastComments SSO Access Control, sometimes referred to as RBAC, users can be restricted to only access certain pages, or comment threads. Additionally, users can only @mention each other in the same group.

In Detail

We can place Users and optionally Pages into groups.

When Users are placed into groups, and Limit Comments by SSO User Groups is enabled in Widget Settings, then users will only see comments from users in their same groups and will only be able to @mention users in the same groups.

Additionally, Pages can be placed into groups, and then users can only access comments for pages they have access to.

We call this "User-Level" groups verses "Page-Level" groups.

So which one is right for you?

Use User-Level Groups if...

  • You want to use the same urlId value (page URL, or article ID), but restrict comments by group.
  • For example, you want to have "New User" and "Veteran User" groups, and they should never see each other's comments on the same pages.

Use Page-Level Groups if...

  • Your groups have specific pages.
  • For example, users in "Public Pages" group should never view articles on the "Top Secret" articles.

How it Works Internal Link

FastComments Access Control works by assigning Pages and Users into the desired groups.

A group is simply a string identifier, like GREEN or abc-123.

Users and Pages are not just limited to one group. They are limited to 100 and 1000 groups, respectively.

Accessing Unauthorized Pages

If a user tries to access a page they don't have access to, they will see an error message, like below:

Authorization Failure Example
Authorization Failure Example

The message text can be customized.

The Spec Internal Link

Defining how multiple users interact, and testing it, is complicated. Here is the following spec that we follow for access control, which you may use to test your implementation:

Page with null group ids, user with null group ids - should have access.
Page with null group ids, user with group ids - should have access.
Page with group ids, user with null group ids - should have access.
Page with group ids, user with empty list - should NOT have access.
Page with group ids, user with group ids - intersection exists - should have access.
Page with group ids, user with group ids - intersection does not exist - should NOT have access.
Page with empty list of group ids (nobody has access), user with null - should NOT have access.

SSO User A = No group ids defined (null = full access).
SSO User B = No group ids defined (null = full access).
A can @B.

SSO User A = No group ids defined (null = full access).
SSO User B = Group ids defined.
A can @B.

SSO User A = Group ids defined.
SSO User B = No group ids defined (null = full access).
A can @B.

SSO User A = Group ids = [a].
SSO User B = Group ids = [b].
A can NOT @B.

SSO User A = Group ids = [a].
SSO User B = Group ids = [a, b].
A can @B.

Implementation Internal Link

Mentioning Users in Other Groups

If two users belong to two different sets of groups, and there is no intersection, they will not be able to @mention each other.

If a user manually types an @mention and submits their comment, it will remain as plain text. The other user will not be tagged.

Maintaining the Groups

Groups are defined using the Pages and SSOUsers API resources, respectively.

The Pages API can be invoked to define the set of groups allowed to access the page. By default, all groups, and users that do not belong to a group, have access.

Similarly, the SSOUsers API can be invoked to define the groups associated with each user.

For both resources, there are no limitations as to when the groups can be set or updated.

If it's only desired to limit users from @mention'ing each other, then Pages do not have to be taken into consideration.

Note!

Defining and updating the SSO user groups does not require using the API, and can instead be updated automatically by defining the group ids in the SSO payload passed to the comment widget. However, for large lists of groups, this is not recommended as the user would have to submit this payload for every page load.