Date when the role was created
OptionaldeletedDate when the role was soft-deleted
OptionaldescriptionThe organization which the role belongs to.
OptionalorganizationThe organization ID which the role belongs to.
The permissionGroups property is an array of permission group IDs associated with a role.
Permission groups provide a way to bundle permissions together for easier management.
By assigning a permission group to a role, users with that role will inherit all permissions defined in the group. This allows developers to modify permissions within groups without updating the role directly.
When a role has multiple permission groups, the system resolves them to a single permissions array for the user with that role, ensuring efficient access control.
The permissions property is an array of strings that holds a list of permissions
associated with the role. These permissions define the specific actions and access
levels that the role grants to its users, enabling fine-grained control over
what users with this role can do within the application.
OptionalproductThe product ID which the role belongs to.
Role title
The type property represents the category of the role, which can be one of the following:
SYSTEM, ORGANIZATION, BRAND, STUDIO, PASSPORT_TYPE, REVIEW or ORGANIZATION_GROUP.
This classification helps to differentiate roles based on their scope and usage within the application.
Date when the role was last updated
StatictargetReturns object that is managed by this repository. If this repository manages entity from schema, then it returns a name of that schema instead.
Checks if entity has an id. If entity composite compose ids, it will check them all.
Recovers a given entity in the database.
Optionaloptions: SaveOptionsReloads entity data from the database.
Removes current entity from the database.
Optionaloptions: RemoveOptionsSaves current entity in the database. If entity does not exist in the database then inserts, otherwise updates.
Optionaloptions: SaveOptionsRecords the delete date of current entity.
Optionaloptions: SaveOptionsStaticaverageStaticclearClears all the data from the given table/collection (truncates/drops it).
StaticcountStaticcountStaticcreateStaticcreateStaticdeleteDeletes entities by a given criteria. Unlike remove method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient DELETE query. Does not check if entity exist in the database.
StaticexistsStaticexistsStaticfindStaticfindFinds entities that match given find options. Also counts all entities that match given conditions, but ignores pagination settings (from and take options).
StaticfindStaticfindStaticfindStaticfindStaticfindStaticfindStaticfindStaticfindStaticgetStaticgetStatichasChecks entity has an id. If entity composite compose ids, it will check them all.
StaticinsertInserts a given entity into the database. Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient INSERT query. Does not check if entity exist in the database, so query will fail if duplicate entity is being inserted.
StaticmaximumStaticmergeStaticminimumStaticpreloadCreates a new entity from the given plain javascript object. If entity already exist in the database, then it loads it (and everything related to it), replaces all values with the new ones from the given object and returns this new entity. This new entity is actually a loaded from the db entity with all properties replaced from the new object.
Note that given entity-like object must have an entity id / primary key to find entity by. Returns undefined if entity with given id was not found.
StaticqueryExecutes a raw SQL query and returns a raw database results. Raw query execution is supported only by relational databases (MongoDB is not supported).
Optionalparameters: any[]StaticremoveStaticsaveStaticsoftStaticsumStaticupdateUpdates entity partially. Entity can be found by a given conditions. Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient UPDATE query. Does not check if entity exist in the database.
StaticupsertInserts a given entity into the database, unless a unique constraint conflicts then updates the entity Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient INSERT ... ON CONFLICT DO UPDATE/ON DUPLICATE KEY UPDATE query.
StaticuseSets DataSource to be used by entity.
The
Roleentity represents a set of permissions and access levels within an application.Each role is characterized by its type, title, status, description, and associated permissions.
Roles can be system-defined, organization-specific, or tailored for different entities like brands, studios, or passport types. They enable fine-grained control over user access and actions, ensuring that users only have the necessary permissions to perform their tasks.