firebase-security

Firebase lazy load

≡放荡痞女 提交于 2019-12-23 01:29:27
问题 I'm trying to lazy load firebase items to later on load more of them whenever user reaches end of div container. When i remove .endAt() and .startAt() i'm receiving the 15 items though they are not beeing incremented and it's stuck at these 15 items. When i keep .endAt() and .startAt() i'm receiving firebase warning Using an unspecified index. Consider adding ".indexOn": "title" at /items even though .indexOn is set. I'm confused by that warning. Thanks in advance for any help. Firebase

Firebase lazy load

余生长醉 提交于 2019-12-23 01:29:00
问题 I'm trying to lazy load firebase items to later on load more of them whenever user reaches end of div container. When i remove .endAt() and .startAt() i'm receiving the 15 items though they are not beeing incremented and it's stuck at these 15 items. When i keep .endAt() and .startAt() i'm receiving firebase warning Using an unspecified index. Consider adding ".indexOn": "title" at /items even though .indexOn is set. I'm confused by that warning. Thanks in advance for any help. Firebase

firebase rules: how to restrict access based on user role

前提是你 提交于 2019-12-23 01:24:43
问题 I'm new to Firebase and trying to understand the security rules. For this I'm implementing typical functionality of Project - Team Members - Tasks. Each project will have a team leader, multiple members and multiple tasks. Here is the structure and rules that I'm trying to implement (a.k.a. Requirements): /Members - each member has { displayName, email, emailVerified } any logged in user should be able to read data from Members (to get the display names of all users) any logged in user should

AngularJS: How to hide the template content until user is authenticated?

半世苍凉 提交于 2019-12-22 18:28:14
问题 My app has 2 pages: main.html and login.html . When not authenticated users go to /main they should be redirected to /login . The problem is that main.html is rendered first, and after a second or so, when user authentication fails, login.html is rendered. How could I prevent from main.html to be rendered until authentication succeeds? Here is the relevant code (CoffeeScript): angular.module('myApp', [...]) .config(['$routeProvider', ($routeProvider) -> $routeProvider.when '/login',

Remove a user from firebase

女生的网名这么多〃 提交于 2019-12-22 10:35:26
问题 I am trying to remove a user programatically from my firebase. The method removeuser takes 2 arguments, email and password. Now email is not hard to find out since this is stored in the auth variable + I am adding it in my database when a user is created. However, how am I supposed to find out the password from the user? When I create a user I do add the generated md5_hash information with this user in my database. However, I can not convert this value back to the real password. I also

Firestore - security rules for users within companies

跟風遠走 提交于 2019-12-21 20:55:37
问题 Our current Firestore structure is as follows: Currently we are not using any subcollections Users have list of companies to which they belong Every project is connected only with 1 company Project belongs to a company, when in companyId field is written that company UID My 1st question is how we can specify security rules defined by this database? Is there some best practice approach? Our first idea was to do this: match /databases/{database}/documents/projects/{projectUid}/{document=**} {

Query-based rules with auth.uid not working

↘锁芯ラ 提交于 2019-12-21 12:31:22
问题 I have the following structure: events -LEe7X118dkcH2JhJRe description: "Testdescr" eventTasks participants 0zlwpSlCazNGjOyMi95h8awshrG2 lastLogin: 1528641494535 userKey: "0zlwpSlCazNGjOyMi95h8awshrG2" username: "User1" 6LnYKxRu2SWUrxwIzId8dDpOrl02 lastLogin: 152856590172 userKey: "6LnYKxRu2SWUrxwIzId8dDpOrl02" username: "User2" I want to query all events, to which an user participants (like a filter). My Java-Code is: mDatabaseReference = FirebaseDatabase.getInstance().getReference("event");

How to programmatically modify security rules in Firebase?

情到浓时终转凉″ 提交于 2019-12-21 05:01:06
问题 The examples in the firebase documents assume manual update of firebase security rules. How can security rules be modified programmatically to support real-world collaborative applications? In the use case that I am considering, the requirement is for a user to be able to invite other users to collaborate/share selected data and to be able to grant/revoke access to the collaborators. How can this be accomplished with firebase? 回答1: You actually shouldn't programmatically change your security

Firebase Security Rules: .indexOn unique ids

心不动则不痛 提交于 2019-12-21 01:13:33
问题 I have this structure: "post": { "groupMember": { "-KHFHEHFWDB1213": "true", "-KSJHDDJISIS011": "true", "-KJSIO19229129k": "true" } } I want to .indexOn the auto-generated unique groupMember ids. I tried doing this: "post": { ".indexOn": "groupMember" ... } But I'm still getting this error: Consider adding ".indexOn": "groupMember/-KHFHEHFWDB1213" at /post So how do I add a .indexOn on a unique id? UPDATE: This is the query I use (in Swift): postRef.queryOrderedByChild("groupMember/\(uid)")

Missing or insufficient permissions when writing to Firestore using field in access rules

不问归期 提交于 2019-12-20 11:07:03
问题 I am getting an error when attempting to write to Firestore. I am attempting to use a field containing the user uid for my security rule. service cloud.firestore { match /databases/{database}/documents { match /messages/{document=**} { allow read: if resource.data.user_uid == request.auth.uid; allow write: if resource.data.user_uid == request.auth.uid; } } } If I have data in my Firestore database, the read rule works fine - but when I attempt to write I get: Error: Missing or insufficient