Comments (5)
Hi @swip3798 ahh that's a bug on the website...
Try the following example (note the commas to separate the different FOR
clauses)...
DEFINE TABLE post SCHEMALESS
PERMISSIONS
FOR select
WHERE published = true
OR user = $auth.id, -- NOTE THE COMMA HERE
FOR create
WHERE user = $auth.id, -- NOTE THE COMMA HERE
FOR delete
WHERE user = $auth.id
OR $auth.admin = true
;
In the meantime, I'll get this changed so that it can work with or without commas, which should make this a little easier and clearer.
from surrealdb.
Thanks a lot!
from surrealdb.
@swip3798 hey man! where can I see the documentation or the complete example of the granular permissions?
Thanks in advance!!!
from surrealdb.
@wzalazar The example I was talking about is in the README of the repository. The other documentation on the website is the documentation of the Define statement. But there is currently only the syntax of the statement but no further explanation. But that will hopefully change in the future.
from surrealdb.
@swip3798 thanks!!! I'm going to take a look ;)
from surrealdb.
Related Issues (20)
- Feature: Adding a custom validation error message when defining fields with assert.
- Bug: Critical Bug returning incorrect values from query HOT 2
- Feature: Add function that allows to sanitize HTML
- Bug: Panic while running an event HOT 1
- Bug: View returns empty if defined via CLI import
- Bug: strings need sanitizing in rust client
- Bug: JWKS Authentication with Microsoft HOT 1
- Bug: Can't parse table name that starts with "function" in CREATE statement
- Bug: JWKS Tokeninfromation lost on restart HOT 1
- Bug: Numbers from script functions in indexed document fields break indexing HOT 1
- Bug: Build fails: error: `sql2` is currently unstable. You need to enable the `surrealdb_unstable` flag to use it. HOT 2
- Bug: Cannot perform division with '0' and '0'
- Incorrect cli behaviour with flaky websocket
- Bug: btree.rs index out of bounds HOT 1
- Bug: using the `RELATE`-statement on an edge that already exists, discards without error HOT 1
- Bug: create statement set parallel keyword ast incorrect
- Bug: Wrong `content-type` response on `/rpc` endpoint
- Bug: Server panic when trying to remove namespace
- Bug: InvalidQuery RenderedError for "REMOVE NAMESPACE IF EXISTS surrealdb" HOT 1
- Bug: High idle cpu usage and log flooded with "Delr page was empty" messages since 1.4.0 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from surrealdb.