Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7112697
roles.test.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
746 B
Referenced Files
None
Subscribers
None
roles.test.ts
View Options
import
{
LONG_TEST_TIMEOUT
}
from
"../test_utils/webhint.js"
;
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"
,
});
})).
timeout
(
LONG_TEST_TIMEOUT
);
});
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Fri, Jul 4, 01:30 (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
799763
Default Alt Text
roles.test.ts (746 B)
Attached To
Mode
rPLAY Sealious playground
Attached
Detach File
Event Timeline
Log In to Comment