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 1087947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:00:19+00:00 2026-05-16T23:00:19+00:00

We’re developing a web app using the Zend framework and Mysql. Currently, accounts are

  • 0

We’re developing a web app using the Zend framework and Mysql.

Currently, accounts are unique by email address. We want to be able to allow the admin of an account to grant access to the admin of another account. This person would then be a “user” of the linked account. The account holder would then log into their admin account and then select which linked account they want to access.

Please note: the access should only be one way. Account 1, who grants access to Account 2, should not be able to access account 2. Only account 2 can access account 1. If Account 1 wanted access to account 2, account 2 would then have to grant access to account 1.

What is the best method of going about this?

  • 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-16T23:00:19+00:00Added an answer on May 16, 2026 at 11:00 pm

    I think trying to tie permissions to accounts is your problem, you need to add a second ‘layer’. Let’s stick with Google Analytics as the example:

    Let’s say Joe Bloggs wants to use Google Analytics. He first has to create a Google account (assuming he doesn’t already have one). He then creates a Google Analytics account for his site. Say Joe then wants to give access to Jane Smith, let’s assume she already has a Google account. To give her access all he is doing is giving her Google account access to his site, he’s not giving her access to his Google account.

    Zend_Acl is role based so let’s try and apply ZF concepts to this example. The user management screens in GA allow you to give users either “View reports only” access, or “Account administrator”. So you’d define a role in Zend_Acl for each of these access levels:

    $acl = new Zend_Acl();
    $acl->addRole(new Zend_Acl_Role('guest'));
    $acl->addRole(new Zend_Acl_Role('admin'), 'guest');
    

    the second parameter on addRole means the role should inherit all permissions from the other role specified. So what I’ve done above is define two roles: guest and admin; and said admin should inherit all permissions that guest has.

    You then have your ‘resources’, which are the things that can be accessed. So we’ll define one for reports, and one for user management:

    $acl->add(new Zend_Acl_Resource('reports'));
    $acl->add(new Zend_Acl_Resource('users'));
    

    we’ll then give ‘guest’ access to reports, and ‘admin’ access to users:

    $acl->allow('guest', 'reports');
    $acl->allow('admin', 'users');
    

    then in the relevant controllers (or plugin, or wherever) you can check permissions:

    public function reportsAction()
    {
        [...]
    
        // assume $role contains the role of the currently logged in user
        if (!$acl->isAllowed($role, 'reports')) {
            // show a permissions error
        }
    }
    
    public function usersAction()
    {
        [...]
    
        if (!$acl->isAllowed($role, 'users')) {
            // permissions error
        }
    }
    

    As far as storing this in MySQL goes, you just need a lookup table that links users, sites (in this example) and roles:

    userID | siteID | role
       1       1      admin
       2       1      guest
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want use html5's new tag to play a wav file (currently only supported
We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
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.