Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 732593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:09:35+00:00 2026-05-14T07:09:35+00:00

I’m creating an admin module for my client that gives them access to some

  • 0

I’m creating an admin module for my client that gives them access to some administration functionality concerning their content. I’m starting off by adding some permissions in my module by implementing hook_perm:

function mymodule_perm() 
{
    return array(
        'manage projects',
    );
}

I can then create my menu by adding to the admin section that already exists:

function mymodule_menu() 
{
    $items['admin/projects'] = array(
        'title' => 'Projects',
        'description' => 'Manage your projects.',
        'page callback' => 'manage_projects_overview',
        'access callback' => 'user_access',
        'access arguments' => array('manage projects'),
        'type' => MENU_NORMAL_ITEM,
        'weight' => -100,
    );

    $items['admin/projects/add'] = array(
        'title' => 'Add project',
        'access arguments' => array('manage projects'),
        'page callback' => 'mymodule_projects_add',
        'type' => MENU_NORMAL_ITEM,
        'weight' => 1,
    );

    return $items;
}

This will add a Projects section to the Administration area with an Add project sub section. All good.

The behavior I want is that my client can only see the Projects section when they log in. I’ve accomplished this by ticking the “manage projects” permission for authenticated users in the permissions section of my module. Now to give my client actual access to the Administration area I also need to tick “access administration pages” under the “system module” in the users permissions section. This works great, when I log in as my client I can only see the Projects section in the Administration area. There is one thing though, In my Navigation menu shown on the left column I can see the following items:

- Administer
   - Projects
   - Content management
   - Site building
   - Site configuration
   - User management

I was expecting only the see Administer and Projects items, not the other ones. When I click e.g. Content Management I get a Content Management titled page with no sub-sections. Same for Site Building, Site Configuration and User Management. What’s really odd is that Reports is not being shown which is also a top level Administration section.

Why are these other items, besides my Projects section, being shown and how can I make them stop from appearing if I’m not logged in as an administrator?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:09:36+00:00Added an answer on May 14, 2026 at 7:09 am

    Your problem is that they are allowed to view those pages.

    From the system module’s hook_menu:

    $items['admin/build'] = array(
      'title' => 'Site building',
      'description' => 'Control how your site looks and feels.',
      'position' => 'right',
      'weight' => -10,
      'page callback' => 'system_admin_menu_block_page',
      'access arguments' => array('access administration pages'),
      'file' => 'system.admin.inc',
    );
    

    So when you gave them access administration pages you gave them access to the site building section, but not any item in it. A quick way to solve this is to:

    • Use hook_menu_alter to change the access settings for those menu items to something they don’t have access to. Either make your own perm or use an existing one.
    • You could also use your theme to just hide the items.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 357k
  • Answers 357k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The other answers are correct. Here is some code you… May 14, 2026 at 9:40 am
  • Editorial Team
    Editorial Team added an answer you ruin the noConflict concept by reassigning the jquery to… May 14, 2026 at 9:40 am
  • Editorial Team
    Editorial Team added an answer If you get that particular error, you don't actually have… May 14, 2026 at 9:40 am

Related Questions

No related questions found

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.