সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
Firebase কনসোলে আপনার আপডেট করা Firebase Security Rules দ্রুত পরীক্ষা করতে, নিয়ম খেলার মাঠ ব্যবহার করুন।
নিয়ম খেলার মাঠ হল একটি সুবিধাজনক টুল ব্যবহার করার জন্য যখন আপনি নতুন আচরণগুলি অন্বেষণ করছেন বা আপনি সেগুলি লেখার সাথে সাথে নিয়মগুলিকে দ্রুত যাচাই করছেন৷ এটি আপনার সিমুলেশনের জন্য সেট করা প্যারামিটার অনুসারে অ্যাক্সেস অনুমোদিত বা অস্বীকার করা হয়েছে তা নিশ্চিত করে একটি বার্তা প্রদর্শন করে।
তারপর, পণ্য নেভিগেশন থেকে, নিম্নলিখিতগুলির মধ্যে একটি করুন:
উপযুক্ত হিসাবে Realtime Database , Cloud Firestore , বা স্টোরেজ নির্বাচন করুন, তারপরে Rules সম্পাদকে নেভিগেট করতে নিয়মগুলিতে ক্লিক করুন৷
একবার আপনি আপনার সম্পাদনাগুলি করে ফেললে, সম্পাদক থেকে নিয়ম খেলার মাঠে ক্লিক করুন৷
নিয়ম খেলার মাঠের সেটিংসে, আপনার পরীক্ষার জন্য বিকল্পগুলি নির্বাচন করুন, যার মধ্যে রয়েছে:
পরীক্ষা পড়া বা লেখা।
একটি পাথ হিসাবে আপনার ডাটাবেস বা স্টোরেজ বালতিতে একটি নির্দিষ্ট অবস্থান ।
প্রমাণীকরণের ধরন — অপ্রমাণিত, প্রমাণীকৃত বেনামী ব্যবহারকারী, বা একটি নির্দিষ্ট ব্যবহারকারী আইডি।
ডকুমেন্ট-নির্দিষ্ট ডেটা যা আপনার নিয়মগুলি বিশেষভাবে উল্লেখ করে (উদাহরণস্বরূপ, যদি আপনার নিয়মগুলি লেখার অনুমতি দেওয়ার আগে একটি নির্দিষ্ট ক্ষেত্রের উপস্থিতি প্রয়োজন হয়)।
রান ক্লিক করুন এবং সম্পাদকের উপরের ব্যানারে ফলাফলগুলি দেখুন।
নমুনা নিয়ম খেলার মাঠের দৃশ্যকল্প
নিম্নলিখিত নমুনা দৃশ্য এবং মৌলিক নিয়মগুলির সাথে খেলার মাঠের আচরণের নিয়মগুলি পরীক্ষা করুন।
Cloud Firestore
service cloud.firestore {
match /databases/{database}/documents {
// Allow only authenticated content owners access
match /some_collection/{document} {
allow read, write: if request.auth != null && request.auth.uid == request.resource.data.author_uid
}
}
}
Realtime Database
// These rules grant access to a node matching the authenticated// user's ID from the Firebase auth token{"rules":{"users":{"$uid":{".read":"$uid === auth.uid",".write":"$uid === auth.uid"}}}}
Cloud Storage
// Grants a user access to a node matching their user IDservicefirebase.storage{match/b/{bucket}/o{// Files look like: "user/<UID>/file.txt"match/user/{userId}/{fileName}{allowread,write:ifrequest.auth!=null && request.auth.uid==userId;}}}
Rules সম্পাদকে, প্রদত্ত নিয়ম যোগ করুন।
সিমুলেশন টাইপ ড্রপ-ডাউন মেনু থেকে get নির্বাচন করুন এবং অবস্থান ক্ষেত্রে একটি বৈধ পথ লিখুন।
প্রমাণীকরণে টগল করুন এবং প্রদানকারী ড্রপ-ডাউন থেকে একটি প্রমাণীকরণের ধরন নির্বাচন করুন।
ব্যবহারকারী আইডি বিবরণ লিখুন এবং রান ক্লিক করুন.
সিমুলেশনের ফলাফল সম্পাদকের শীর্ষে প্রদর্শিত হবে। আপনি যে ইউজার আইডি বিশদ লিখেছেন তার উপর নির্ভর করে, আপনি একটি ব্যানার দেখতে পাবেন যা নিশ্চিত করে যে পাঠটি সফলভাবে অনুমোদিত বা অস্বীকার করা হয়েছে।
[null,null,["2025-07-25 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["\u003cbr /\u003e\n\nTo quickly test your updated Firebase Security Rules in the Firebase console, use\nthe Rules Playground.\n| **Note:** To fully validate your app's behavior and verify your Firebase Security Rules \n| configurations, use the [Firebase Emulator](/docs/rules/emulator-setup) to run and automate unit tests in a local environment.\n\nThe Rules Playground is a convenient tool to use as you're exploring\nnew behaviors or quickly validating rules as you write them. It displays a\nmessage confirming that access was either allowed or denied according to the\nparameters you set for the simulation.\n\nUse the Rules Playground\n\n1. Open the [Firebase console](//console.firebase.google.com/) and select your project.\n2. Then, from the product navigation, do one of the following:\n - Select **Realtime Database** , **Cloud Firestore** , or **Storage** , as appropriate, then click **Rules** to navigate to the Rules editor.\n3. Once you've made your edits, click **Rules Playground** from the editor.\n4. In the *Rules Playground* settings, select options for your test, including:\n - Testing reads or writes.\n - A specific **Location** in your database or storage bucket, as a path.\n - Authentication type --- unauthenticated, authenticated anonymous user, or a specific user ID.\n - Document-specific data that your rules specifically reference (for example, if your rules require the presence of a specific field before allowing a write).\n5. Click **Run** and look for the results in the banner above the editor.\n\nSample Rules Playground scenario\n\nTest the Rules Playground behavior with the following sample scenario\nand basic rules. \n\nCloud Firestore \n\n service cloud.firestore {\n match /databases/{database}/documents {\n // Allow only authenticated content owners access\n match /some_collection/{document} {\n allow read, write: if request.auth != null && request.auth.uid == request.resource.data.author_uid\n }\n }\n }\n\nRealtime Database\n\n\u003cbr /\u003e\n\n```scilab\n // These rules grant access to a node matching the authenticated\n // user's ID from the Firebase auth token\n {\n \"rules\": {\n \"users\": {\n \"$uid\": {\n \".read\": \"$uid === auth.uid\",\n \".write\": \"$uid === auth.uid\"\n }\n }\n }\n }\n \n```\n\n\u003cbr /\u003e\n\nCloud Storage \n\n // Grants a user access to a node matching their user ID\n service firebase.storage {\n match /b/{bucket}/o {\n // Files look like: \"user/<UID>/file.txt\"\n match /user/{userId}/{fileName} {\n allow read, write: if request.auth != null && request.auth.uid == userId;\n }\n }\n }\n\n- In the Rules editor, add the rule given.\n\n-\n Select **get** from the **Simulation type** drop-down menu and enter a valid\n path in the **Location** field.\n\n- Toggle on **Authentication** and select an authentication type from the\n **Provider** drop-down.\n\n- Enter the user ID details and click **Run**.\n\nThe results of the simulation appear at the top of the editor. Depending on the\nuser ID details you entered, you should see a banner confirming the read\nwas either successfully allowed or denied."]]