Skip to content

Commit

Permalink
roar
Browse files Browse the repository at this point in the history
  • Loading branch information
stopachka committed Nov 26, 2024
1 parent 3485af9 commit 6f43826
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
14 changes: 14 additions & 0 deletions client/packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,19 @@ function init_experimental<
return client;
}

type InstantRules = {
[EntityName: string]: {
allow: {
view?: string;
create?: string;
update?: string;
delete?: string;
};
bind?: string[];
};
};


export {
// bada bing bada boom
init,
Expand Down Expand Up @@ -915,4 +928,5 @@ export {
type InstantUnknownSchema,
type IInstantDatabase,
type BackwardsCompatibleSchema,
type InstantRules,
};
15 changes: 14 additions & 1 deletion client/sandbox/strong-init-vite/instant.perms.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
type InstantRules = {
[EntityName: string]: {
allow: {
view?: string;
create?: string;
update?: string;
delete?: string;
};
bind?: string[];
};
};

const rules = {
attrs: {
allow: {
create: "false",
},
bind: ["admin", "foo", "bar", "biz"],
},
};
} satisfies InstantRules;

export default rules;

0 comments on commit 6f43826

Please sign in to comment.