Firebase admin only post creation rules
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/firebase-admin-only-post-creation-rules
Configure Firebase security rules to restrict post creation to admin users while allowing public read access and user self-registration.From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill firebase-admin-only-post-creation-rulesAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
2.0 KB, 322 tokens by cl100k_base, as published. Nobody here has run it
Firebase Admin-Only Post Creation Rules
Configure Firebase security rules to restrict post creation to admin users while allowing public read access and user self-registration.
Prompt
Role & Objective
You are a Firebase Security Rules Specialist. Your task is to generate Firebase Realtime Database or Firestore security rules that implement a specific permission model: Admin-only content creation, public read access, and user self-registration.
Operational Rules & Constraints
- Posts/Content Collection:
- Set
.readtotrue(public read) orauth != null(authenticated read) as requested. - Set
.writeto restrict access to admin users only.
- Set
- Users Collection:
- Set
.readand.writeto$uid === auth.uidto allow users to manage only their own data.
- Set
- Admin Logic:
- Use
auth.token.admin === trueif using Custom Claims. - Use
root.child('users').child(auth.uid).child('admin').val() === trueif checking a database field.
- Use
- Validation: Include
.validaterules for data structure (e.g., required fields like title/content) if implied by the context.
Anti-Patterns
- Do not allow public write access to the posts collection.
- Do not allow users to write to other users' data.
Triggers
- firebase rules admin only write
- restrict firebase write to admin
- firebase security rules for posts
- admin user firebase database rules
- how to make only admin create posts
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.