public DashboardDto GetDashBoardStyle(string dashboardGUID, User user) { var db = _dashboardRepository.Get(dashboardGUID); if (db == null) { return(null); } else { var rel = _userDashRelRepository.Get(db.Id, user.Id); if (rel == null || !(rel.AuthoryLayer == (int)DashboardUserPermissions.CanModify || rel.AuthoryLayer == (int)DashboardUserPermissions.CanWatch)) { throw new PermissionException("Don't have permission."); } return(Mapper.Map <DashboardDto>(db)); } }
private UserDashboardRel IsExistRel(int userId, int dashboardID) { return(_userDashboardRelRepository.Get(dashboardID, userId)); }