More access permissions

Hi,

Could anyone help me a little. I'm trying to modify Content Profile module so I can add more permissions exept administer nodes that can create a profile for other users. Since there are many places in the code that deal with access permissions I can't seem to find the right spot to add 1 more permission.

This seems to be the right place for that:


function content_profile_page_access($type, $account) {
  if ($node = content_profile_load($type, $account->uid)) {
    return node_access('update', $node);
  }
  // Else user may view the page when they are going to create their own profile
  // or have permission to create it for others.
  global $user;
  if ($user->uid == $account->uid || user_access('administer nodes') ){
    return node_access('create', $type);
  }
  return FALSE;
}

but when I try to do something like

function content_profile_page_access($type, $account) {
  if ($node = content_profile_load($type, $account->uid)) {
    return node_access('update', $node);
  }
  // Else user may view the page when they are going to create their own profile
  // or have permission to create it for others.
  global $user;
  if ($user->uid == $account->uid || user_access('administer nodes') || user_access('permission') ){
    return node_access('create', $type);
  }
  return FALSE;
}

Where permission is properly named permission from the list it dosent work. I also tried adding "|| user_access('permission')" to other places in code where user_access('administer nodes') shows up but no luck still cant make it work.

Login to post comments