开发者

Drupal TAC not working? Setup wrong? [closed]

开发者 https://www.devze.com 2023-04-11 23:47 出处:网络
Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 10 years ago.

Improve this question

I'm new to Drupal and decided to use Drupal 7 to manage a user system in which one logged in user sees one page, and another logged in user sees another page. I've got it set up to the point where each user logs in and is directed to their landing page, no problem. However if once logged in, user 1 attempts to view users 2's landing page (by say changing the url in address bar) then user 1 is looking at user 2's landing page, not supposed to happen. It work in reverse as well.

I've set up Taxonomy Access Control but not sure if I'm setting it up properly maybe? The Lite version won't set up properly (though it seems more applicable here) and it fails when rebuilding permissions. So TAC is all I can find to do this. I cannot figure out where to add the "terms" to my content. I have set up roles - viewerCompany1 and viewerCompany2 and I have my users defined properly with these开发者_如何学JAVA roles. I just can't figure out how to tell Drupal "don't allow user 1 to see landing page 2".


Harp, your almost there. This is how I usually set it up in D7.

  1. Create a role called "Members"
  2. Create a new vocabulary called "Access"
  3. Add two terms to the "Access" vocabulary, "Public" and Members Only"
  4. Add a new field to each content type - Admin > Structure > Content Types of type term reference. I usually use the checkbox widget but it is up to you.
  5. Set the vocabulary to be the "Access" vocabulary you set up in step 2
  6. Set the default to be "Public" - this is optional but it means all pages are publicly accessible unless specifically set to "Members Only"
  7. Save
  8. Go to the Manage Display settings for that content type
  9. Set the Access field to hidden
  10. save
  11. Now go to Admin > Configuration > Taxonomy access control
  12. Go to edit access rules for anonymous users
  13. Under "New" select members in the dropdown
  14. Set each option in the row to "D"
  15. Click Add
  16. Do steps 12 to 15 for the authenticated user
  17. Do steps 12 to 15, expect select "A" instead of "D" for the members role

Now when you select Members Only for the Access field on any node, that node will not be visible to the anonymous and authenticated users. Any user with the Members role will be able to view the node. This will also hide menu items that are directed to this node. See the taxonomy terms documentation for more help. https://drupal.org/node/31601


You need to add a new field to your content type of type 'Term Reference', then link it to the appropriate vocabulary(s). Then edit the nodes in question and choose which categories they should be part of.

Once you've done this the nodes will be linked to taxonomy terms so the TAC module should then work as expected.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号