public bool CanUserModifyProtocol(string userId, int protocolId)
        {
            var department = _departmentsService.GetDepartmentByUserId(userId);
            var protocol   = _protocolsService.GetProcotolById(protocolId);

            if (department == null || protocol == null)
            {
                return(false);
            }

            if (protocol.DepartmentId != department.DepartmentId)
            {
                return(false);
            }

            if (department.IsUserAnAdmin(userId))
            {
                return(true);
            }

            return(false);
        }
Exemple #2
0
        public IActionResult GetProtocol(int id)
        {
            var template = _protocolsService.GetProcotolById(id);

            return(Json(template));
        }