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

  • SEARCH
  • Home
  • 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 914937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:48:08+00:00 2026-05-15T17:48:08+00:00

I’m contemplating using Zend_ACL. However, to me it looks like you create roles and

  • 0

I’m contemplating using Zend_ACL. However, to me it looks like you create roles and then give those roles permissions to controllers and actions they can or cannot access.

However, to me that seems fairly limited. I have created a user permission system in the past where I stored the user_id, the module, the controller and the action they can access, however I never gave them a group. Therefore it was a per user, per module, per controller, per action basic on what they could access.

So! I’m wondering if I wanted to be less limited by groups that I should give the user a group and set those group permissions by default. Then load my user specific roles and over write the roles set by the default group: is that how you guys would do it?

  • 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-15T17:48:09+00:00Added an answer on May 15, 2026 at 5:48 pm

    Thanks for your feedback guys, however I decided to create my own. In case anyone’s interested:

    public function verify($controller=NULL, $action='index', $module='administration') {
    
        if ((isset($this->object[$module]['all']) && is_string($this->object[$module]['all'])) || isset($this->object[$module][$controller][$action]) || (isset($this->object[$module][$controller]) && is_string($this->object[$module][$controller]))) {
            return true;
        }
    }
    
    public static function check($values) {
    
        $module         = $values['module']     ? $values['module']     : 'administration';
        $controller     = $values['controller'] ? $values['controller'] : 'index';
        $action         = $values['action']     ? $values['action']     : 'index';
        $user_id        = $values['user_id'];
    
        $db    = Zend_Registry::get('dbAdapter');
        $query = $db->prepare(" 
            SELECT * 
            FROM `".self::table_name."` 
            WHERE 
                (
                    (`module` = :module AND `controller` = :controller AND `action` = :action) OR
                    (`module` = :module_2 AND `controller` = :controller_2 AND `action` = '') OR 
                    (`module` = :module_3 AND `controller` = '' AND `action` = '')
                )
            AND enabled = 1 
            AND user_id = :user_id      
            ");
    
        $query->bindValue('module',         $module);
        $query->bindValue('module_2',       $module);
        $query->bindValue('module_3',       $module);
        $query->bindValue('controller',     $controller);
        $query->bindValue('controller_2',   $controller);
        $query->bindValue('action',         $action);
        $query->bindValue('user_id',        $user_id);
    
        $query->execute();
        $item = $query->fetch(PDO::FETCH_OBJ);
        $query->closeCursor();
    
        if (is_object($item)) {
            return $item;
        } else {
            throw new exception("Could not load user permission for this page ($module, $controller, $action)");
        }
    }
    

    and in the view:

        <?php if ($this->user_permissions->verify('movie')) { ?>
            <li class="parent">
                <img src="/design/images/icon/dvd.png" /> <span class="highlighter"><a href="/administration/movie/index">Movie</a></span>
                <?php if ($this->user_permissions->verify('movie', 'add')) { ?>
                     | <a href="/administration/movie/add">Add</a>
                <?php } ?>
                <?php if ($this->user_permissions->verify('movie', 'featured')) { ?>
                    <ul>
                        <li>
                            <img src="/design/images/icon/order.png" /> <a href="/administration/movie/featured">Order Featured</a>
                        </li>
                    </ul>
                <?php } ?>
            </li>
        <?php } ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.