I have a field in my content type and i want that field value to Edit/Create by two roles i.e. "administrator" and viewable only by "tester", so, it should not be display for administrator.If administrator has another role "tester", then it should be display for him , else not at all.
I have done, I have given field view permission to tester and not administrator, but still it's viewable by administrator.
Please see to it.

Thank you.


David Stosik’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

If by "administrator" you mean user 1, then it is not a bug. Whatever you do, user 1 will have all permissions granted, and be able to see all fields, that's a choice deep in Drupal core.
If by "administrator" you mean the "administrator" role created on Drupal installation, the one that is set as "Administrator role" in "Account settings" (/admin/config/people/accounts), then it is also normal.
If that's not the case, then please explain a bit more and I'll have a look.


vishy_singhal’s picture

I have been reading a lot of forums and comments about the module does not work for admin pages.

I looked at some of the common codes and found that the following line used in a JS was creating problems.

REPLACE >> $('table#permissions').once('permissions', function () {
BY >> $('form#user-admin-permissions table#permissions').once('permissions', function () {

maxilein’s picture

Which problems do you mean?
After changing these lines, will it work on Admin pages?

David Stosik’s picture

BY >> $('form#user-admin-permissions table#permissions').once('permissions', function () {

I'm sorry but your jQuery selector looks wrong. An HTML element cannot have two ids, so using the # sign twice is probably an error.

Can you please describe your problem more precisely, and explain what did you meant by "administrator" in your first post?

Edit: misreading, I didn't see a space, the selector does not look wrong, sorry about that.

vishy_singhal’s picture

@maxelein - Yes it will work. I have tested it out successfully.

David Stosik’s picture

Isn't this code breaking anything, especially on non admin pages?
Thank you,

vishy_singhal’s picture

The code works perfectly fine. I have tested in on many pages.

mariacha1’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (outdated)

I'm inclined to close this due to the changes between beta1 and beta2 -- not sure it's still relevant.