-1

Okay so this is how my app is supposed to function: it works like uber. Just that instead of hiring Drivers, users will be hiring helpers to clean their homes. Do you have any idea of how to make the app function in accordance to specific accounts? Like when user logs in using his account and it's authenticated using firebase.

Okay imagine this scenario :

Imagine that there's 2 users using this app. User 1 applies to become a helper. User 2 applies to become a requester(the one who requests for a helper). So user 2 will create a job request (that means keying in all the necessary data(date, time etc)) which will be saved to firebase. And user 1 will be able to look at the list of job requests made by different people.

Any idea how to tie those requests to specific accounts? (Job request 1 belongs to person 1, job request 2 belongs to person 2 etc). Is there a way to do this with firebase authentication? Or is there any other ways? In need of examples.

Colin Wong
  • 131
  • 2
  • 11

1 Answers1

0

User Grouping is possible in firebase

Example:

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 */
    }
  }
}

reference

Subtain Ishfaq
  • 793
  • 9
  • 16
  • Is there a way to give privileges to individual users? – Colin Wong Jul 09 '17 at 02:00
  • Yes we can provide privileges in similar way, it is no-sql so you have to make the json to handle privileges. If this answer helped you please accept it. – Subtain Ishfaq Jul 09 '17 at 09:58
  • Yes we can provide privileges in similar way, it is no-sql so you have to make the json to handle privileges. If this answer helped you please accept it. – Subtain Ishfaq Jul 09 '17 at 09:58