The link generated by a View's header (Global: Text area) is only visible for the admin role and I need it to show for other roles I have the following code in the View's header (Global: Text area).

&lt;?php
  global $user;
  if (user_access('create page content', $user)) {
    $output = l(t('Publica un artículo nuevo'), 'node/add/articulo');
    print $output;
  }
?&gt;


If I log in as admin I can add an "articulo" by clicking on the link that the PHP generates in the header of the view. However if I log in as a different role I can still add an "articulo" by using the navigation menu but for some reason the link generated by the code above disappears i.e. the link is only visible for the admin role and I want it to be visible for other roles as well. I have tried changing the permissions for the different roles but it has not worked. If the other roles can create content from the navigation menu why does this link disappear for them. Do I need to change something within the view or ...?

Thanks in advance.
As per your code , you need to make sure two things...


Logged in User should have create page content access in permissions since your code checks for that permission
Logged in User should also have access to create articulo content "node/add/articulo" since l function checks for user access of the  path he is trying to access.


Make sure logged in user role have both permissions in your permissions list. Clear cache and rebuild permissions before verifying.

In your case , Make sure the different role you are mentioning has "create page content" permission.