Giter Site home page Giter Site logo

Comments (4)

DevSnap avatar DevSnap commented on May 8, 2024 1

@eldadfux
Thanks i really appreciate it.

from appwrite.

eldadfux avatar eldadfux commented on May 8, 2024

Confirmed. I will check it out and try to add some docs on this issue later today or tomorrow.

from appwrite.

eldadfux avatar eldadfux commented on May 8, 2024

@MrNiceDev don't want to leave you hanging until i'll be able to complete missing docs.

Here is an example JSON with complete collection structure, of course this is not a replacement for full documentation but at least something to be able to play around with.

    {
        "$collection": 0,
        "$permissions": {
            "read": [
                "*"
            ],
            "write": [
                "role:admin"
            ]
        },
        "name": "Articles",
        "structure": true,
        "rules": [
            {
                "$collection": "rules",
                "$permissions": {
                    "read": [
                        "*"
                    ],
                    "write": [
                        "role:admin"
                    ]
                },
                "label": "Source",
                "key": "source",
                "type": "text",
                "default": "",
                "required": false,
                "array": false
            },
            {
                "$collection": "rules",
                "$permissions": {
                    "read": [
                        "*"
                    ],
                    "write": [
                        "role:admin"
                    ]
                },
                "label": "Type",
                "key": "type",
                "type": "text",
                "default": "",
                "required": false,
                "array": false
            },
            {
                "$collection": "rules",
                "$permissions": {
                    "read": [
                        "*"
                    ],
                    "write": [
                        "role:admin"
                    ]
                },
                "label": "URL",
                "key": "url",
                "type": "text",
                "default": "",
                "required": false,
                "array": false
            },
            {
                "$collection": "rules",
                "$permissions": {
                    "read": [
                        "*"
                    ],
                    "write": [
                        "role:admin"
                    ]
                },
                "label": "Language",
                "key": "language",
                "type": "text",
                "default": "",
                "required": false,
                "array": false
            },
            {
                "$collection": "rules",
                "$permissions": {
                    "read": [
                        "*"
                    ],
                    "write": [
                        "role:admin"
                    ]
                },
                "label": "Title",
                "key": "title",
                "type": "text",
                "default": "",
                "required": false,
                "array": false
            },
            {
                "$collection": "rules",
                "$permissions": {
                    "read": [
                        "*"
                    ],
                    "write": [
                        "role:admin"
                    ]
                },
                "label": "Description",
                "key": "description",
                "type": "text",
                "default": "",
                "required": false,
                "array": false
            },
            {
                "$collection": "rules",
                "$permissions": {
                    "read": [
                        "*"
                    ],
                    "write": [
                        "role:admin"
                    ]
                },
                "label": "Image",
                "key": "image",
                "type": "url",
                "default": "",
                "required": false,
                "array": false
            },
            {
                "$collection": "rules",
                "$permissions": {
                    "read": [
                        "*"
                    ],
                    "write": [
                        "role:admin"
                    ]
                },
                "label": "Body",
                "key": "body",
                "type": "text",
                "default": "",
                "required": false,
                "array": false
            },
            {
                "$collection": "rules",
                "$permissions": {
                    "read": [
                        "*"
                    ],
                    "write": [
                        "role:admin"
                    ]
                },
                "label": "Body Length",
                "key": "bodyLength",
                "type": "numeric",
                "default": "",
                "required": false,
                "array": false
            },
            {
                "$collection": "rules",
                "$permissions": {
                    "read": [
                        "*"
                    ],
                    "write": [
                        "role:admin"
                    ]
                },
                "label": "Section",
                "key": "section",
                "type": "text",
                "default": "",
                "required": false,
                "array": false
            },
            {
                "$collection": "rules",
                "$permissions": {
                    "read": [
                        "*"
                    ],
                    "write": [
                        "role:admin"
                    ]
                },
                "label": "Tags",
                "key": "tags",
                "type": "text",
                "default": "",
                "required": false,
                "array": true
            },
            {
                "$collection": "rules",
                "$permissions": {
                    "read": [
                        "*"
                    ],
                    "write": [
                        "role:admin"
                    ]
                },
                "label": "Create Date",
                "key": "createdAt",
                "type": "numeric",
                "default": "",
                "required": false,
                "array": false
            },
            {
                "$collection": "rules",
                "$permissions": {
                    "read": [
                        "*"
                    ],
                    "write": [
                        "role:admin"
                    ]
                },
                "label": "Update Date",
                "key": "updatedAt",
                "type": "numeric",
                "default": "",
                "required": false,
                "array": false
            },
            {
                "$collection": "rules",
                "$permissions": {
                    "read": [
                        "*"
                    ],
                    "write": [
                        "role:admin"
                    ]
                },
                "label": "Comments",
                "key": "comments",
                "type": "document",
                "default": "",
                "required": false,
                "array": true
            }
        ]
    }

from appwrite.

eldadfux avatar eldadfux commented on May 8, 2024

I have just updated the rules documentation on https://appwrite.io/docs/rules. Please let me know everything is clear. I have added examples for both the creation of a simple collection and a collection with nested children.

from appwrite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.