mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
14 lines
361 B
TypeScript
14 lines
361 B
TypeScript
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);
|
|
}
|
|
};
|