Make visible internal xml pages

quanton81 - June 24, 2009 - 10:36
Project:SIOC
Version:6.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:quanton81
Status:active
Description

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.

#1

scor - June 24, 2009 - 14:23

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'),
  );

#2

quanton81 - June 24, 2009 - 15:07

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?

#3

quanton81 - June 24, 2009 - 15:46

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??

#4

scor - June 24, 2009 - 17:50

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.

#5

quanton81 - June 24, 2009 - 19:46

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

 
 

Drupal is a registered trademark of Dries Buytaert.