Smartdoc Methods and ‘Content Based’ Access

I am trying to impose role based access on APIs using Content Access Module. I have created a smartDocs model for the APIs using Swagger specification. Once the model is published, I have enabled role based access on the page settings for a custom role.

As an anonymous user when I view /{smartDocs-model}/apis I get access denied error.

So far good...

But when I directly test a particular page say - /{smartDocs-model}/apis/get/{api-uri} as an anonymous user I can still view the page.

I have disabled access to anonymous users at both content type (admin/structure/types/manage/smart_method/access) and at node level (/node/91/access).

But still anonymous users can view the individual API pages. How can I ensure that access is denied to anonymous user for these pages?

So far i have used following links:

Link1 , Link2, Link3

Thanks in advance!!

Solved Solved
0 2 217
1 ACCEPTED SOLUTION

Hi @Vikaas - I tested it out, and I ran into the same issue. The fix is to rebuild permissions after you change them in the Content Access module. To do this:

  1. In Drupal, run the Status Report (Reports > Status Report).
  2. In the middle of that report, you'll see a "Node Access Permissions" section. Click the Rebuild Permissions link.

    1686-content-access-rebuild-permissions.png

That worked for me. Hope it does for you, too.

P.S. Found the answer in this thread: https://www.drupal.org/node/1344622

View solution in original post

2 REPLIES 2

Hi @Vikaas - I tested it out, and I ran into the same issue. The fix is to rebuild permissions after you change them in the Content Access module. To do this:

  1. In Drupal, run the Status Report (Reports > Status Report).
  2. In the middle of that report, you'll see a "Node Access Permissions" section. Click the Rebuild Permissions link.

    1686-content-access-rebuild-permissions.png

That worked for me. Hope it does for you, too.

P.S. Found the answer in this thread: https://www.drupal.org/node/1344622

works like a charm!!