AmitXShukla / Online-School-Management-App-Angular-Firebase

Angular 11.0 Firebase App - Online School , Student Management App
184 stars 88 forks source link

firebase database tables #15

Closed cirilinfo closed 3 years ago

cirilinfo commented 4 years ago

Hi, I have used the firebase roles but tables not generate. How to generate tables in firebase.

AmitXShukla commented 4 years ago

You will need to create only one collection SMS_ROLES so that your app can authenticate users against roles. rest of the collections will automatically be created as your access app write data into database. Please look into screenshots. https://medium.com/@Amit_Shukla/online-school-management-app-8e58449427c0

cirilinfo commented 4 years ago

Hi, i have log in the app but unable to do the settings find my screenshot and let me know the solutions. settings

AmitXShukla commented 4 years ago

can you try changing this collection (as mentioned below) and see if the solves the issue, and if does, please try adding conditions back one at a time and see which condition is failing.

-----AFTER match /SMS_USERS/{document} { allow create: if true; allow update: if true; allow read: if true; } --------------------BEFORE match /SMS_USERS/{document} { allow create: if exists(/databases/$(database)/documents/SMS_ROLES/$(request.resource.data.secretKey)) && get(/databases/$(database)/documents/SMS_ROLES/$(request.resource.data.secretKey)).data.role == request.resource.data.role; allow update: if exists(/databases/$(database)/documents/SMS_ROLES/$(request.resource.data.secretKey)) && get(/databases/$(database)/documents/SMS_ROLES/$(request.resource.data.secretKey)).data.role == request.resource.data.role && isDocOwner(); allow read: if isSignedIn() && isDocOwner(); }

cirilinfo commented 4 years ago

same issue

db_NEW settings

AmitXShukla commented 4 years ago

why you have match /SMS_USERS/{document} rules twice line #7 and line #12 You need to keep only one set (means, get rid of line #12 through #19)

cirilinfo commented 4 years ago

i have removed one set but still facing the same issue db_NEW

AmitXShukla commented 4 years ago

I will download this repository and run this later this week. Please expect a fix by Monday. Also, FYI - I have a new series coming up this week, where I discuss how to setup Firebase rules and Role based security in detail. Please subscribe https://www.youtube.com/amitshukla_ai and give a star to this repository https://github.com/AmitXShukla/ERP-Apps-CRM-Cloud-Angular_FireStore

cirilinfo commented 4 years ago

@AmitXShukla any update on the firebase ROLE issue.

AmitXShukla commented 4 years ago

Sorry to keep you waiting, I'm busy with other project.

For now, just update every thing to true (not recommended approach for sure) and I will update these rules later this week.

allow create: if true; allow update: if true; allow read: if true;

cirilinfo commented 4 years ago

@AmitXShukla i have set everything true but still having same issues.

AmitXShukla commented 4 years ago

Can you please include some screenshots of errors from web and terminal console. I have this repository open, will fix it all at once.

cirilinfo commented 4 years ago

@AmitXShukla find the screenshots for your reference

fb pe pe1

AmitXShukla commented 4 years ago

Temporary fix for You is, Set everything to true In your collections, only user roles is true, rest aren’t.

To learn more about how to setup rules, please watch this video

https://youtu.be/AuZejtI7uU8

I’ll fix this repository once I finish my current project.

AmitXShukla commented 4 years ago

update this repo to latest Angular 9.1.4 version, Please download and re-install this app

AmitXShukla commented 3 years ago

update this repo to v 11.0