2

I have created a user, now I want to give him permissions so that, when he is logged in, he can view/see all the contents, but can't edit/publish/unpublish/delete them.

Of all the contents, he can view/edit/publish/unpublish/delete only those contents, that has United Kingdom as taxonomy term, for example something like.

Logged in user can see all the contents, but If any content has Country -> "United Kingdom", then give permission to edit/publish/unpublish that particular content?

I have already tried Taxonomy Access Control, but didn't help me. Either I couldn't see any content, or I could edit all of them.

I want to give permission based on Taxonomy term.

I think I will probably need to do bit of coding.

Help?

2

I have used the Taxonomy Access module before and it should work for what you need to do here.

I'm making some assumptions here:

1) You have a vocabulary called "Country" and "United Kingdom" is a term in that list.

2) You have a field of type "Term Reference" on your content type(s) and it using the "Country" vocabulary.

3) You have a field of type "Term Reference" on your account settings - /admin/config/people/accounts/fields and it using the "Country" vocabulary.

Now, make sure your permissions are set properly:

1) go to /admin/config/people/taxonomy_access

2) "edit access rules" for the "authenticated user" to get to this page: enter image description here

3) Under "New" you need to select the term you want to manage access for. Hit the "Add" button.

4) Once added, the term with show under the "Tags" heading in the table. I am using the "Tags" vocabulary here, but yours will say "Country".

5) Now you can modify the permissions for View, Update, Delete, Add Tag and View Tag. There is an explanation of these fields as well as how to manage the permission on the bottom of that page, so I wont include it here.

After you have done this, you can login as an authenticated user and the permissions configured above will control the access to your content.

  • Hi, Thanks for the detailed answer. It helped me to understand it more clearly. I did exactly what you said, but now I have these problems. 1) Anonymous User can't see any taxonomy while creating the content now, I have Country, and Project Vocabulary, but they can't see that now. 2) Authenticated user can edit the content which has "United Kingdom" but can't delete it. 3) Authenticated user can't see the other taxonomy vocabularies other than Country while creating a content, and they can't choose any other country other than United Kingdom while creating a content. – user3365207 Jun 20 '14 at 10:44
  • The Taxonomy Access Permission which I have given to default under Global is View -> Allow, Update -> Ignore, Delete -> Ignore, Add Tag -> Unchecked, View Tag -> Checked. And for "United Kingdom" under Country Vocabulary is View -> Allow, Update -> Allow, Delete -> Allow, Add Tag -> Checked, View Tag -> Checked. Can you see anything wrong? Thanks – user3365207 Jun 20 '14 at 10:49
  • 1) My ansswer above is for authenticated users only. If you want annonymous users to have access to content, you need to manage the anonymous user role. – Scott Joudry Jun 20 '14 at 12:07
  • 2) Based on what you have provided, you should be able to delete content. Have you rebuilt the permissions? – Scott Joudry Jun 20 '14 at 12:08
  • 3) should also work based on what you've provided. – Scott Joudry Jun 20 '14 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.