Hi,
I have installed the SIOC module on my site. Which generates some xml pages inside my site according to SIOC. The problem is that when I try to access them with an external script it gave me access denied. I searched on the permissions but this module has no permissions. I want to read those xml pages but with a anonymous user I can’t access. Any idea of how I can modify the permissions of these files or how can a gave permissions to my script to work with these pages.

Comments

scor’s picture

can you paste the paths which give you access denied? the module reuse the permissions from other core modules, this might help:

  $items['sioc/blog/%'] = array(
    'access arguments' => array('access content'),
  );
  $items['sioc/user/%'] = array(
    'access arguments' => array('access user profiles'),
  );
  $items['sioc/node/%node'] = array(
    'access callback' => 'node_access',
    'access arguments' => array('view', 2),
  );
  $items['sioc/stories/%node'] = array(
    'access callback' => 'node_access',
    'access arguments' => array('view', 2),
  );
  $items['sioc/forum/%'] = array(
    'access arguments' => array('access content'),
  );
  $items['sioc'] = array(
    'access arguments' => array('access content'),
  );
quanton81’s picture

http://websemantico.altervista.org/drupal/?q=sioc/site this is the first link I try to parse with an external script and it gave me acces denied if I am anonymous user!

Maybe I have to modify something in

$items['sioc/site'] = array(
    'title' => 'sioc forum',
    'page callback' => 'sioc_page',
    'access callback' => 'sioc_access',
    'access arguments' => array('administer users', 'administer nodes'),
    'weight' => '9',
    'type' => MENU_CALLBACK,
  );
  $items['sioc'] = array(
    'title' => 'sioc',
    'page callback' => 'sioc_page',
    'access arguments' => array('access content'),
    'weight' => '9',
    'type' => MENU_CALLBACK,
  );

this part of the code to access it?

quanton81’s picture

I solved the problem with

$items['sioc/site'] = array(
    'title' => 'sioc forum',
    'page callback' => 'sioc_page',
    'access arguments' => array('access content'),
    'weight' => '9',
    'type' => MENU_CALLBACK,
  );

do you think this may cause any security problem??

scor’s picture

yes that looks good. not sure why that got into the code, but this should be indeed open to anyone with the "access content" perm.

quanton81’s picture

Thank you very much for your help!!!! You are very kind! :))

Freso’s picture

Title: Make visible internal xml pages » Make ?q=sioc/site accessible with "access content" permission
Assigned: quanton81 » Unassigned
Category: support » bug
Status: Active » Needs review
StatusFileSize
new664 bytes

And here is comment #3 in patch form, ready to commit. :)