edgedb
edgedb copied to clipboard
Access Policy Internal Server Error
- EdgeDB Version: 2.1
- OS Version: Windows 10
Steps to Reproduce:
- Create schema like the one below
- Create a migration and migrate the database
- Try to
select Organization - See error same as below
Schema:
type User {
multi link organizations := .<users[is Organization];
multi link roles -> Role {
on target delete allow;
property itemId -> uuid;
}
}
type Role {
required property description -> str;
multi link permissions -> Permission;
}
type Permission {
required property slug -> str;
required property allow -> bool {
default := true;
};
index on (.slug);
index on ((.slug, .allow));
constraint exclusive on ((.slug, .allow))
}
type Organization {
multi link users -> User {
on target delete allow;
};
access policy read_allow_org
allow select
using
(
exists
(
select .users
{
roles:
{
permissions filter .slug = 'READ_ORG' and .allow = true
}
} filter
.id ?= global currentUserId
and .roles@itemId = Organization.id
)
)
}
Error: Can provide more of the stack trace if needed
edgedb error: InternalServerError: None
Hint: This is most likely a bug in EdgeDB. Please consider opening an issue ticket at https://github.com/edgedb/edgedb/issues/new?template=bug_report.md
Server traceback:
Traceback (most recent call last):
File "/home/edgedb/.local/share/edgedb/portable/2.1/lib/python3.10/site-packages/edb/pgsql/compiler/__init__.py", line 120, in compile_ir_to_sql_tree
qtree = dispatch.compile(ir_expr, ctx=ctx)
File "/home/edgedb/.local/share/edgedb/portable/2.1/lib/python3.10/functools.py", line 889, in wrapper
return dispatch(args[0].__class__)(*args, **kw)