Drupal 7 views exposed filter shows up even when the user does not have access to the field - drupal-7

I have a view that shows user profile fields in a tabular format. There is a "Country" field, which is not accessible to anonymous users. When viewed as anonymous user, the field is not shown by Views, which is correct. However, I also have the same field exposed, so that users can filter by "Country". The exposed filter shows up for anonymous user and an anonymous user can actually filter by the field, even though he does not see the field value. Am I missing something or it is normal behavior? Is there a way to force the filter to be hidden for anonymous users?

If you want to achieve this without having to do any custom coding, you can try to display the filter as a block and set the permissions on the block to display only to authenticated users.

This in fact is a known issue and detailed at http://drupal.org/node/1352654. As per the last comment in that issue this "wont fix". That's strange, and certainly not to my liking. Hopefully there will be some solution in a future version.

Related

Iframe content not able to save in module params Joomla

I am using Joomla3 with tinymce editor. I have created one module and adding one params in textarea
I am adding iframe code
in text area
but it's not saving. If i am save normal text string then it's saving
Please help me
I believe you need to add a filter to your xml code.
such as:
filter="RAW" or, probably more appropriately, filter="HTML"
This will keep Joomla from cleaning your code. There are a number of filters available to XML fields when creating modules. You can examine the code here: https://github.com/joomla/joomla-cms/blob/master/libraries/joomla/filter/input.php#L167 to see the exact list.
What user group is the account you are using a member of? Super Users and Administrator group types should have no filtering set by default but it sounds like you might need to edit those settings.
From the main menu:
System > Global Configuration > Text Filters (tab)
You will see all the available user groups for you website. The group your user belongs to should have a Filter Type of No Filtering. Another important note is its better to add the user account to a group with the permissions then to arbitrarily adding it to a group type typically reserved for registrants, guests or low-level editing.

How do I display an input field for Users, in a visualforce page?

I simply want to display an input field, that will let me capture a user, so I can filter a list from a custom object by owner. CustomObject__c.OwnerId is not writable, so when I bind it to an input field, nothing is displayed on my page! I don't want to have a drop down list of users (There could be hundreds!) and I don't want to create a spurious custom object with a writeable field, related to the User object. How can I get the input field functionality for a read only field, as if it were writeable?
OwnerId field should be writeable. Unless your field security permissions are messed up or for example the field is hidden because it's a detail in Master-Detail relationship.
But when you'll manage to get it to work you'll see that most likely it's a bit weird lookup that can point to User or Queue.
If you're fine with that - great, just check the security around the field. If you need really only a lookup to user - check if you have any custom Lookup(User) field? You could create a dummy record of that type in the controller and don't do any DML with it, just use the fact it'll have the lookup.
If you don't have any custom ones - I think that Account / Contact / Opportunity owner must be a user (can't have queues). You might have to force <apex:input field... required="false"/> but other than that it should OK?

Salesforce field level access determined by third variable

For the contacts object, I have a custom checkbox which represents whether the contact owner wants the contact information (email and phone) to be visible. Most of our contacts will be completely visible to everyone. However, for a few contacts, we want them to be visible but their contact information needs to be hidden to everyone except for the owner.
Is there a way to set field-level access dependent on another variable? Could you create a workflow to redirect to another page layout if the contact information is visible? If so, can you restrict objects to certain field layouts depending on whether or not you are the record owner? And would would the contact information for "hidden contacts" still show up in reports?
Redirects, custom Visualforce view page etc hacks are all nice and shiny until you realize people will be able to pull data they want via some reports, list views, Outlook integration, mobile apps etc ;)
There's no straightforward answer because field visibility is really "all or nothing" (by Profiles & Permission Sets). Owner/Role-related stuff will help you only if you'd store data in some new related objects.
Another option - Store public part in Leads (public read only for example) and sensitive part - in Contacts (private)? Some lookup to link the 2, maybe a trigger when new Contact is created and you're good to go.
Last but not least - have a look at https://salesforce.stackexchange.com/questions/777/can-i-grant-different-field-level-security-based-on-record-ownership for some ideas.
If I understood correctly (My english...) You could create a new RecordType and a new customized page layout without this fields assigned to it, then you have to create a WFR that change the Recordtype when the cheked field becomes true.
I'm assuming that you know how you have to give permissions to this new Recordtype...etc
Hope this helps.

Show related users on user page

On the user page (/user/20 for example) I want to display a view with some related users. Each user has a field of type entity reference that points to a user. The users are related if they point to the same user.
I tried to do this using the Entity Views Attach module, but didn't succeed (although I think it should be possible using it).
Could someone give me some advice on how I could do this?
I would create an block (or eva) view using contextual filters with your reference field that takes the uid from the url (or node's author) as parent.
maybe this other post can help
PR

Best way to populate a dropdown sitewide that is

I am using CakePHP 1.3 and a layout which includes a dropdown of organizations a user has access to administer, so I'm trying to populate that dropdown with organizations that contain the userid that is logged in, but I want to populate it before the user sees anything so they can use it in the header. The dropdown needs to appear on every page once logged in. I tried adding the query to pull these organizations in the appcontroller, but userid was not yet available to use in before filter. Where or how should I do this? Should it be in session or is there a better construct to use? Element?
In my app it's no problem to use the user_id from within the beforeRender (if you are using the Auth-Component).
You can use it with $this->Auth->user('id').
I would do it like this: Check in the AppController if the user is logged in. If he is, pull your wanted information from the database (or whereever you get your information from) and store it in a variable called $dropdown for example.
If the user is not logged in, $dropdown will be false.
You now make this variable available to the view with $this->set(compact('dropdown'))
Now in your layout (this is important to you have it on every page) you can easily do a check if $dropdown is false or not. If not, you can work with your variable and show the user your wanted dropdown.

Resources