Licensed to be used in conjunction with basebox, only.
@bb_owned_with_access
Syntax
type TypeName @bb_owned_with_access
{
ObjectFields
}
Notes
The @bb_owned_with_access
directive instructs the compiler that the object type is considered an owned object with the option to grant access to specific records to specific other users.
The corresponding database table will include an .ownerId
and an .accessIds
column, specifying the user who owns the record and the ones who are allowed to access a specific record.
type Report @bb_owned_with_access {
id: ID!
title: String!
description: String
}
This example informs the compiler that all records in the Report object/table will be considered owned with optional access by others. The user creating the access grants owns the respective records. So as for @bb_owned
and @bb_user
, the IdP user's ID will be written in the .ownerId
column on the INSERT
operation.
When inserting a Report
, access to it can be defined in @bb_resolver
. The access grants can also be defined, updated or removed with an UPDATE
operation.
For more details on how to do this, please check out the _grant_access
attribute documentation in the @bb_resolver.