不确定从哪里开始(我四处寻找帮助)。甚至不确定我是否要问正确的问题,因为在这种情况下我找不到任何文档或教程。我发现并开始使用Firebase firestore进行登录/身份验证,但组>用户>内容上没有任何内容。也许我搜索的字词错误。
我想用Firebase(Firestore)在Vue中构建一个应用程序。我希望不同的公司注册并创建用户帐户,一旦他们注册,就可以CRUD他们创建的文章。
我的问题:
1)Firestore的这种结构是否足够平坦?还是有更好的方法?
Companies: - Company-1 > Can access Articles 1, 4 & 7 - Company-2 > Can access Articles 6 & 9 - Company-3 > Can access Articles 2, 3, 5 & 8 Users: - User-1 > Belongs to Company-1 (access Articles 1, 4 & 7) - User-2 > Belongs to Company-1 (access Articles 1, 4 & 7) - User-3 > Belongs to Company-1 (access Articles 1, 4 & 7) - User-4 > Belongs to Company-2 (access Articles 6 & 9) - User-5 > Belongs to Company-3 (access Articles 1, 4 & 7) - User-6 > Belongs to Company-1 (access Articles 1, 4 & 7) Articles: - Article 1 - Article 2 - Article 3 - Article 4 - Article 5 - Article 6 - Article 7 - Article 8 - Article 9
{ "companies": { "company1": { "canCRUD": "[atricleID_1, atricleID_4, atricleID_7]" }, "company2": { "canCRUD": "[atricleID_2, atricleID_3, atricleID_5, atricleID_8]" }, "company3": { "canCRUD": "[atricleID_6, atricleID_9]" } }, "users": { "user_1": { "memberOfCompany": "company1", "uid": "123" }, "user_2": { "memberOfCompany": "company1", "uid": "321" }, "user_3": { "memberOfCompany": "company2", "uid": "132" }, "user_4": { "memberOfCompany": "company2", "uid": "312" }, "user_5": { "memberOfCompany": "company3", "uid": "213" } }, "articles" :{ "articleID_1": { "atricleContent": "here..." }, "atricleID_2": { "atricleContent": "here..." }, "articleID_3": { "atricleContent": "here..." }, "articleID_4": { "atricleContent": "here..." }, "articleID_5": { "atricleContent": "here..." }, "articleID_6": { "atricleContent": "here..." }, "articleID_7": { "atricleContent": "here..." }, "articleID_8": { "atricleContent": "here..." }, "articleID_9": { "atricleContent": "here..." }2)我可以使用Vue / Vuex或Cloud函数处理组/用户角色/权限吗?
} }
如果您可以指出正确的方向;太棒了!