Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F10360930
roles.test.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
656 B
Referenced Files
None
Subscribers
None
roles.test.ts
View Options
import
{
withProdApp
}
from
"../test_utils/with-prod-app.js"
;
describe
(
"roles"
,
()
=>
{
it
(
"allows access to users with designated role and denies access to users without it"
,
async
()
=>
withProdApp
(
async
({
app
})
=>
{
await
app
.
collections
.
users
.
suCreate
({
username
:
"regular-user"
,
password
:
"password"
,
email
:
"regular@example.com"
,
roles
:
[],
});
const
admin
=
await
app
.
collections
.
users
.
suCreate
({
username
:
"someadmin"
,
password
:
"admin-password"
,
email
:
"admin@example.com"
,
roles
:
[],
});
await
app
.
collections
[
"user-roles"
].
suCreate
({
user
:
admin
.
id
,
role
:
"admin"
,
});
}));
});
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Sat, Nov 8, 10:00 (21 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1034439
Default Alt Text
roles.test.ts (656 B)
Attached To
Mode
rREWRITE Configurable rewriter
Attached
Detach File
Event Timeline
Log In to Comment