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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:31:32+00:00 2026-06-17T20:31:32+00:00

I couldn’t find it in the docs but is there a way to define

  • 0

I couldn’t find it in the docs but is there a way to define a group of users and use that group to grant access to different locations, rather than granting access to individual users?

Regards,
LT

  • 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-06-17T20:31:33+00:00Added an answer on June 17, 2026 at 8:31 pm

    There’s no explicit support for "groups" in Firebase, because you can represent them yourself quite easily. Here are two options, depending on your situation.

    Storing group information in firebase.

    The following data could be used to represent 2 groups (‘alpha’ and ‘beta’) and 3 pieces of protected data (‘thing1’, ‘thing2’, and ‘thing3’)

    {
      "groups": {
        "alpha": {
          "joe": true,
          "sally": true
        },
        "beta": {
          "joe": true,
          "fred": true
        }
      },
      "data": {
        "thing1": {
          "group": "alpha"
          /* data accessible only by the "alpha" group */
        },
        "thing2": {
          "group": "beta"
          /* data accessible only by the "beta" group */
        },
        "thing3": {
          "group": "alpha"
          /* more data accessible by the "alpha" group */
        }
      }
    }
    

    Then we can use the following rules to enforce security:

    {
      "rules": {
        "data": {
          "$thing": {
            ".read":  "root.child('groups').child(data.child('group').val()).hasChild(auth.id)",
            ".write": "root.child('groups').child(data.child('group').val()).hasChild(auth.id)"
          }
        }
      }
    }
    

    So then if I’m authenticated with { id: ‘sally’ } as my auth object, I’ll have access to thing1 and thing3, but not thing2.

    Storing group information in the auth token.

    If you’re generating your own auth tokens and you know what groups a user is in at the time they auth, you could store the list of groups in the auth token you generate. For example, when you generate the auth token for user ‘fred’, include "{ id: ‘fred’, groups: { alpha: true, beta: true } }"

    And then you can enforce group membership with:

    {
      "rules": {
        "data": {
          "$thing": {
            ".read": "auth[data.child('group').val()] != null",
            ".write": "auth[data.child('group').val()] != null"
          }
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Couldn't find it anywhere (google or stackoverflow). Is there a way to force Dump()'s
Couldn't find this in the faq. Does Flurry give analytics that distinguish users? So
I couldn't think of a way to word the title, so sorry for that,
I couldn't find anything on this, but probably its just because I don't know
Couldn't find an answer to this anywhere, but essentially I am wanting to add
Couldn't find a trace of the source code behind the Photos application that runs
Couldn't find an answer to this question. It must be obvious, but still. I
I couldn't find any documentation on gitk about what the colors mean, but the
I couldn't find out python equivalent to PHP $_SERVER. Is there any? Or, what
Couldn't find a function for this. I'm assuming I need to use regex? I'm

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.