mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat(nestjs): migrate to NestJS
This commit is contained in:
13
packages/server/src/modules/Roles/Roles.utils.ts
Normal file
13
packages/server/src/modules/Roles/Roles.utils.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { ServiceError } from '../Items/ServiceError';
|
||||
import { ERRORS } from './constants';
|
||||
import { Role } from './models/Role.model';
|
||||
|
||||
/**
|
||||
* Valdiates role is not predefined.
|
||||
* @param {IRole} role - Role object.
|
||||
*/
|
||||
export const validateRoleNotPredefined = (role: Role) => {
|
||||
if (role.predefined) {
|
||||
throw new ServiceError(ERRORS.ROLE_PREFINED);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user